Hi Matthias, you are correct, this is a bug in the MicroBird/MedSAFE classes. This might be a good idea to mention that we now have a public bug tracker available at http://bugs.mitk.org/ Could you enter this as a bug report?
Thanks Jochen -----Original Message----- From: Matthias Noll [mailto:[email protected]] Sent: Tue 7/7/2009 16:17 To: Neuhaus Jochen Cc: Mitk Mailingliste Subject: Re: AW: [mitk-users] Problem with the destruction of a functionality which makes use of the MedSAFE tracking device Hi all, after using the random tracker for a while now I switched back to the MedSAFE tracker. And here I solved the problem I encountered and mentioned in my previous email. The reason why the error occurs is the following. When closing the MainApp, every smartpointer destructor is called. The call of ~TrackingDeviceSource leads to the call of TrackingDeviceSource::Disconnect(); which then calls MedSAFETrackingDevice::CloseConnection(); In this CloseConnection(), the members m_TransmitterConfig and m_SensorConfig are deleted but NOT set to NULL. if (m_TransmitterConfig) delete [] m_TransmitterConfig; if (m_SensorConfig) delete [] m_SensorConfig; This will be also done by the destructor of the tracking device, in this case ~MedSAFEtrackingDevice(); which , if I'm not mistaken, always is preceded by the above CloseConnection(); call .The condition "if (m_TransmitterConfig)" stays true and delete will be called again even if the array is already deleted. Hence m_TransmitterConfig and m_SensorConfig have to be set to NULL within the MedSAFETrackingDevice::CloseConnection(); or the member array deletion has to be removed completely. The same problem subsists in the core code of MircoBird and should be changed. Regards, Matthias Neuhaus Jochen wrote: > Hi Matthias, > > we do not have a MedSave/MicroBird tracker at our institution, so I cannot > debug into it. Does it happen in the destructor or in the CloseConnection() > method? > Maybe you can debug into the code and see what is wrong with > m_TransmitterConfig. It should be initialized in OpenConnection and deleted > in CloseConnection(). > > Regards, > Jochen > > >> -----Ursprüngliche Nachricht----- >> Von: Matthias Noll [mailto:[email protected]] >> Gesendet: Donnerstag, 4. Juni 2009 16:02 >> An: Mitk Mailingliste >> Betreff: [mitk-users] Problem with the destruction of a functionality >> which makes use of the MedSAFE tracking device >> >> Hi, >> >> I have a problem with a functionality, which makes use of the MedSAFE >> tracking device. As soon as I close the MainApp and having previously >> selected/clicked my functionality, I get a debug assertion failure >> thrown from within the dbgdel.cpp: >> >> Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) >> >> The problem seems to be caused by one of the following calls. I have >> tried various combinations with them, in my functionality code: >> >> m_Source->StopTracking(); >> m_Source->Disconnect(); >> m_Source = NULL; >> m_Tracker = NULL; >> >> I tried to go through the calls as well and the problem seems to >> originate from: >> >> delete [] m_TransmitterConfig; >> >> I dont't know how I can prevent this form happening. >> >> Regards, >> Matthias >> >> ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/blackberry _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
