Crash Stack -- Deleting the Mass Balance Data Object from the workspace context menu ("Delete") ...
1-13-2012 -- See code excerpts below.

 msvcp90d.dll!std::_Debug_message(const wchar_t * message=0x000000014177e0c0, const wchar_t * file=0x000000014177ce20, unsigned int line=304)  Line 24	C++
 msvcp90d.dll!std::_Debug_message(const unsigned short * message=0x000000014177e0c0, const unsigned short * file=0x000000014177ce20, unsigned int line=304)  Line 30	C++
 riverware.exe!std::_Tree<std::_Tset_traits<SimObj * __ptr64,std::less<SimObj * __ptr64>,std::allocator<SimObj * __ptr64>,0> >::const_iterator::operator==(const std::_Tree<std::_Tset_traits<SimObj *,std::less<SimObj *>,std::allocator<SimObj *>,0> >::const_iterator & _Right=0xcdcdcdcdcdcdcdcd {_kind=??? _tipe={...} _longTypeName={...} ...})  Line 305	C++
 riverware.exe!std::_Tree<std::_Tset_traits<SimObj * __ptr64,std::less<SimObj * __ptr64>,std::allocator<SimObj * __ptr64>,0> >::const_iterator::operator!=(const std::_Tree<std::_Tset_traits<SimObj *,std::less<SimObj *>,std::allocator<SimObj *>,0> >::const_iterator & _Right=0xcdcdcdcdcdcdcdcd {_kind=??? _tipe={...} _longTypeName={...} ...})  Line 316 + 0xf bytes	C++
 >	riverware.exe!WorkspaceSelection::remove(SimObj * obj=0x000000002ffa8f60)  Line 589 + 0x58 bytes	C++
 riverware.exe!WorkspaceSelection::deselect(SimObj * obj=0x000000002ffa8f60)  Line 81 + 0x17 bytes	C++
 riverware.exe!Workspace::deleteObject(SimObj * obj=0x000000002ffa8f60)  Line 2487	C++
 riverware.exe!Workspace::callbackHandler(CallbackType type=WS_OBJECT_REMOVED, CallbackData * cbData=0x00000000002f3710)  Line 6427	C++
 riverware.exe!Workspace_allCallbacksCBNoteProc(Callback * __formal=0x0000000004e942e0, CallbackType type=WS_OBJECT_REMOVED, CallbackData * data=0x00000000002f3710, void * clientData=0x0000000004aebbd0)  Line 6383	C++
 riverware.exe!FunctionCb::invoke(CallbackType type=WS_OBJECT_REMOVED, CallbackData * cbData=0x00000000002f3710)  Line 14	C++
 riverware.exe!Root::callCallbacks(CallbackType type=WS_OBJECT_REMOVED, CallbackData * cbData=0x00000000002f3710)  Line 224	C++
 riverware.exe!SimWorkspace::deleteSimObj(SimObj * obj=0x000000002ffa8f60, void * d=0x00000000257c8580, bool deleteanyway=true)  Line 2146 + 0x43 bytes	C++
 riverware.exe!SimWorkspace::deleteSimObj(const QString & simObjName={...})  Line 2073	C++
 riverware.exe!WorkspaceGfxScene::deleteSimObj(SimObj * obj=0x000000002ffa8f60, bool showConfirmDlg=true)  Line 3868	C++
 riverware.exe!WorkspaceGfxScene::deleteSimObjConfirm()  Line 3754 + 0x19 bytes	C++
 riverware.exe!WorkspaceGfxScene::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=21, void * * _a=0x00000000002f3bb0)  Line 169 + 0xa bytes	C++
 riverware.exe!SimulationGfxScene::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=47, void * * _a=0x00000000002f3bb0)  Line 64 + 0x18 bytes	C++
 QtCored4.dll!QMetaObject::metacall(QObject * object=0x00000000050e1000, QMetaObject::Call cl=InvokeMetaMethod, int idx=47, void * * argv=0x00000000002f3bb0)  Line 238	C++
 QtCored4.dll!QMetaObject::activate(QObject * sender=0x00000000050e5f10, const QMetaObject * m=0x00000000660a5ec8, int local_signal_index=1, void * * argv=0x00000000002f3bb0)  Line 3301	C++
 QtGuid4.dll!QAction::triggered(bool _t1=false)  Line 264	C++
 QtGuid4.dll!QAction::activate(QAction::ActionEvent event=Trigger)  Line 1257	C++
 QtGuid4.dll!QMenuPrivate::activateCausedStack(const QList<QPointer<QWidget> > & causedStack={...}, QAction * action=0x00000000050e5f10, QAction::ActionEvent action_e=Trigger, bool self=true)  Line 1004	C++
 QtGuid4.dll!QMenuPrivate::activateAction(QAction * action=0x00000000050e5f10, QAction::ActionEvent action_e=Trigger, bool self=true)  Line 1097	C++
 QtGuid4.dll!QMenu::mouseReleaseEvent(QMouseEvent * e=0x00000000002f4cb8)  Line 2313	C++
 QtGuid4.dll!QWidget::event(QEvent * event=0x00000000002f4cb8)  Line 8045	C++
 QtGuid4.dll!QMenu::event(QEvent * e=0x00000000002f4cb8)  Line 2422	C++
 QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x00000000002f9178, QEvent * e=0x00000000002f4cb8)  Line 4302 + 0x15 bytes	C++
 QtGuid4.dll!QApplication::notify(QObject * receiver=0x00000000002f9178, QEvent * e=0x00000000002f4cb8)  Line 3867 + 0x51 bytes	C++
 QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x00000000002f9178, QEvent * event=0x00000000002f4cb8)  Line 726 + 0x1d bytes	C++
 QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x00000000002f9178, QEvent * event=0x00000000002f4cb8)  Line 218 + 0x4c bytes	C++
 QtGuid4.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver=0x00000000002f9178, QMouseEvent * event=0x00000000002f4cb8, QWidget * alienWidget=0x0000000000000000, QWidget * nativeWidget=0x00000000002f9178, QWidget * * buttonDown=0x00000000660a7bb0, QPointer<QWidget> & lastMouseReceiver={...}, bool spontaneous=true)  Line 2965 + 0x16 bytes	C++
 QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG & msg={...})  Line 3171 + 0x3f bytes	C++
 QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x0000000000330e1c, unsigned int message=514, unsigned __int64 wParam=0, __int64 lParam=5177390)  Line 1629 + 0x15 bytes	C++
 user32.dll!0000000076a29bd1() 
 [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] 
 user32.dll!0000000076a298da() 
 QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002f8fd0)  Line 781	C++
 QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002f901c)  Line 1145 + 0x27 bytes	C++
 QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002f9080)  Line 150	C++
 QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002f90f0)  Line 197 + 0x3f bytes	C++
 QtGuid4.dll!QMenu::exec(const QPoint & p={...}, QAction * action=0x0000000000000000)  Line 2064	C++
 riverware.exe!SimObjGfxItem::showSimObjContextMenu(const QPoint & evtScreenPos={...})  Line 1914	C++
 riverware.exe!SimObjGfxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * evt=0x00000000002fa390)  Line 1148	C++
 QtGuid4.dll!QGraphicsItem::sceneEvent(QEvent * event=0x00000000002fa390)  Line 6516	C++
 QtGuid4.dll!QGraphicsItem::sceneEvent(QEvent * event=0x00000000002fa390)  Line 6499	C++
 QtGuid4.dll!QGraphicsScenePrivate::sendEvent(QGraphicsItem * item=0x0000000024f794c0, QEvent * event=0x00000000002fa390)  Line 1191	C++
 QtGuid4.dll!QGraphicsScene::contextMenuEvent(QGraphicsSceneContextMenuEvent * contextMenuEvent=0x00000000002fa390)  Line 3561 + 0x17 bytes	C++
 riverware.exe!WorkspaceGfxScene::contextMenuEvent(QGraphicsSceneContextMenuEvent * evt=0x00000000002fa390)  Line 3406	C++
 QtGuid4.dll!QGraphicsScene::event(QEvent * event=0x00000000002fa390)  Line 3362	C++
 QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x00000000050e1000, QEvent * e=0x00000000002fa390)  Line 4302 + 0x15 bytes	C++
 QtGuid4.dll!QApplication::notify(QObject * receiver=0x00000000050e1000, QEvent * e=0x00000000002fa390)  Line 3706 + 0x1d bytes	C++
 QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x00000000050e1000, QEvent * event=0x00000000002fa390)  Line 726 + 0x1d bytes	C++
 QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver=0x00000000050e1000, QEvent * event=0x00000000002fa390)  Line 215 + 0x50 bytes	C++
 QtGuid4.dll!QGraphicsView::contextMenuEvent(QContextMenuEvent * event=0x00000000002fb4d0)  Line 2814	C++
 QtGuid4.dll!QWidget::event(QEvent * event=0x00000000002fb4d0)  Line 8212	C++
 QtGuid4.dll!QFrame::event(QEvent * e=0x00000000002fb4d0)  Line 557 + 0xf bytes	C++
 QtGuid4.dll!QAbstractScrollArea::viewportEvent(QEvent * e=0x00000000002fb4d0)  Line 1036 + 0xf bytes	C++
 QtGuid4.dll!QGraphicsView::viewportEvent(QEvent * event=0x00000000002fb4d0)  Line 2788	C++
 QtGuid4.dll!QAbstractScrollAreaPrivate::viewportEvent(QEvent * event=0x00000000002fb4d0)  Line 100 + 0x35 bytes	C++
 QtGuid4.dll!QAbstractScrollAreaFilter::eventFilter(QObject * o=0x0000000005102840, QEvent * e=0x00000000002fb4d0)  Line 116 + 0x3d bytes	C++
 QtCored4.dll!QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject * receiver=0x0000000005102840, QEvent * event=0x00000000002fb4d0)  Line 841 + 0x1a bytes	C++
 QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x0000000005102840, QEvent * e=0x00000000002fb4d0)  Line 4298 + 0x15 bytes	C++
 QtGuid4.dll!QApplication::notify(QObject * receiver=0x0000000005102840, QEvent * e=0x00000000002fb4d0)  Line 3946 + 0x51 bytes	C++
 QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x0000000005102840, QEvent * event=0x00000000002fb4d0)  Line 726 + 0x1d bytes	C++
 QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x0000000005102840, QEvent * event=0x00000000002fb4d0)  Line 218 + 0x4c bytes	C++
 QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG & msg={...})  Line 3251 + 0x16 bytes	C++
 QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x00000000000a0930, unsigned int message=517, unsigned __int64 wParam=0, __int64 lParam=19923427)  Line 1629 + 0x15 bytes	C++
 user32.dll!0000000076a29bd1() 
 user32.dll!0000000076a298da() 
 QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002ff700)  Line 781	C++
 QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002ff74c)  Line 1145 + 0x27 bytes	C++
 QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002ff7b0)  Line 150	C++
 QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> * flags=0x00000000002ff820)  Line 197 + 0x3f bytes	C++
 QtCored4.dll!QCoreApplication::exec()  Line 1003 + 0x23 bytes	C++
 QtGuid4.dll!QApplication::exec()  Line 3582	C++
 riverware.exe!rwGUIExecute()  Line 140	C++
 riverware.exe!interactiveMode(int argc=1, char * * argv=0x00000000030ac2a0, bool isRunAllowed=true)  Line 688 + 0x1a bytes	C++
 riverware.exe!main(int argc=1, char * * argv=0x00000000030ac2a0)  Line 623 + 0x3a bytes	C++
 riverware.exe!WinMain(HINSTANCE__ * instance=0x000000013f910000, HINSTANCE__ * prevInstance=0x0000000000000000, char * __formal=0x00000000003f48cf, int cmdShow=1)  Line 131 + 0x16 bytes	C++
 riverware.exe!__tmainCRTStartup()  Line 574 + 0x42 bytes	C
 riverware.exe!WinMainCRTStartup()  Line 399	C
 kernel32.dll!000000007690652d() 
 ntdll.dll!0000000076dec521() 
 
bool WorkspaceSelection::remove(SimObj *obj)
{
   std::set<SimObj*>::iterator iter = _selectedSimObjs.find(obj);

   if (iter != _selectedSimObjs.end())
   {
      if (_simObjIter != _selectedSimObjs.end() && *(_simObjIter) == obj)
      {
         _simObjIter++;
      }
   
      _selectedSimObjs.erase(iter);

      return true;
   }

   return false;
}