]> Creatis software - clitk.git/blobdiff - segmentation/clitkAnatomicalFeatureDatabase.txx
Romulo:
[clitk.git] / segmentation / clitkAnatomicalFeatureDatabase.txx
index 0a15c6b5631d852323deab7f307318dd1d0ac610..1aad4f6eec882f08f2ee2964feb095b75b4258f6 100644 (file)
@@ -54,6 +54,8 @@ SetImage(TagType tag, std::string f, typename ImageType::Pointer image, bool wri
 {
   SetImageFilename(tag, f);
   m_MapOfImage[tag] = &(*image);
+  // I add a reference count because the cache is not a smartpointer
+  image->SetReferenceCount(image->GetReferenceCount()+1);
   if (write) {
     writeImage<ImageType>(image, f);
   }