From: jfa Date: Thu, 23 Jun 2011 13:12:25 +0000 (+0000) Subject: Fix memory error. X-Git-Tag: V6_3_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5be32841517498366a925e6c0f4c7d4a4a5f7a8b;p=modules%2Fgui.git Fix memory error. --- diff --git a/src/LightApp/LightApp_Study.cxx b/src/LightApp/LightApp_Study.cxx index e481427b0..4bbf7a886 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -550,9 +550,9 @@ QVariant LightApp_Study::getObjectProperty(int theViewMgrId, QString theEntry, Q QVariant& aResult = theDefValue; ViewMgrMap::ConstIterator v_it = myViewMgrMap.find(theViewMgrId); if(v_it != myViewMgrMap.end()){ - const ObjMap& anOnjectMap = v_it.value(); - ObjMap::ConstIterator o_it = anOnjectMap.find(theEntry); - if(o_it != anOnjectMap.end()) { + const ObjMap& anObjectMap = v_it.value(); + ObjMap::ConstIterator o_it = anObjectMap.find(theEntry); + if(o_it != anObjectMap.end()) { const PropMap& aPropMap = o_it.value(); PropMap::ConstIterator p_it = aPropMap.find(thePropName); if(p_it != aPropMap.end()) { @@ -580,22 +580,24 @@ void LightApp_Study::removeViewMgr( int theViewMgrId ) { */ const PropMap& LightApp_Study::getObjectPropMap(int theViewMgrId, QString theEntry) { ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId); - if(v_it != myViewMgrMap.end()){ - ObjMap& anOnjectMap = v_it.value(); - ObjMap::Iterator o_it = anOnjectMap.find(theEntry); - if(o_it != anOnjectMap.end()) { + if (v_it != myViewMgrMap.end()) { + ObjMap& anObjectMap = v_it.value(); + ObjMap::Iterator o_it = anObjectMap.find(theEntry); + if(o_it != anObjectMap.end()) { return o_it.value(); } else { PropMap aPropMap; - anOnjectMap.insert(theEntry, aPropMap); - return anOnjectMap.find(theEntry).value(); + anObjectMap.insert(theEntry, aPropMap); + return anObjectMap.find(theEntry).value(); } } else { PropMap aPropMap; ObjMap anObjMap; anObjMap.insert(theEntry,aPropMap); myViewMgrMap.insert(theViewMgrId, anObjMap); - return anObjMap.find(theEntry).value(); + + ObjMap& anObjectMap = myViewMgrMap.find(theViewMgrId).value(); + return anObjectMap.find(theEntry).value(); } }