Gui: ActiveObject: remove upon delete
Squashed with: Gui: MDIView: connection bug. Gui: MDIView: forgot disconnect.
This commit is contained in:
@@ -54,3 +54,18 @@ bool Gui::ActiveObjectList::hasObject(const char*name)const
|
||||
{
|
||||
return _ObjectMap.find(name) != _ObjectMap.end();
|
||||
}
|
||||
|
||||
void ActiveObjectList::objectDeleted(const ViewProviderDocumentObject& viewProviderIn)
|
||||
{
|
||||
App::DocumentObject* object = viewProviderIn.getObject();
|
||||
//maybe boost::bimap or boost::multi_index
|
||||
std::map<std::string, App::DocumentObject*>::iterator it;
|
||||
for (it = _ObjectMap.begin(); it != _ObjectMap.end(); ++it)
|
||||
{
|
||||
if (it->second == object)
|
||||
{
|
||||
_ObjectMap.erase(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user