X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FGObjectsMVCFactory.cxx;h=41b3fe06aa57e36d987bb3976983363e52234b41;hb=228d83d191151e160937f836bc768365e55e1cf0;hp=d495b72ea90ae4649dabc3d18b5465c5500b9ad6;hpb=62f479996c001d53a10c45e3ad6a3651b8007668;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx index d495b72..41b3fe0 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx @@ -62,10 +62,20 @@ namespace bbtk //========================================================================= BlackBoxDescriptor::Pointer GObjectsMVCFactory::getBlackBoxDescriptor(std::string packageName, std::string boxName) - { - Factory::Pointer factory = _interpreter->GetExecuter()->GetFactory(); - Package::Pointer k = factory->GetPackage(packageName); - std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc = k->GetDescriptorMap(); + { + Factory::Pointer factory; + Package::Pointer k; + std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc; + try{ + factory = _interpreter->GetExecuter()->GetFactory(); + k = factory->GetPackage(packageName); + mapDesc = k->GetDescriptorMap(); + }catch(Exception e){ + printf("SCP: Exception in BlackBoxDescriptor::Pointer GObjectsMVCFactory::getBlackBoxDescriptor for package %s\n", packageName.c_str()); + printf("SCP: ERROR package %s probably does not exist\n", packageName.c_str()); + } + + return mapDesc[boxName]; } @@ -82,6 +92,8 @@ namespace bbtk void GObjectsMVCFactory :: destroyInstance() { + //FCY memory leaks + delete instance; instance=NULL; }