TobiasMadsen / dgRaph

Discrete factor graphs in R
3 stars 2 forks source link

Use of Rcpp Module causes dangling pointers #8

Closed TobiasMadsen closed 9 years ago

TobiasMadsen commented 9 years ago

A well known problem with Rcpp Modules. http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2014-June/007758.html

Easiest way to reproduce is:

E.g.

varDim <- 2
facPot <- list(matrix(0.5,1,2))
facNbs <- list(1)
mydfg <- dfg(varDim, facPot, facNbs)

save.image(".RData")

mydfg <- 2

gctorture()

load(".RData")

mydfg$dfgmodule$resetFactorPotentials( list(matrix(0.5,1,2)) )