X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdocs.cpp;h=bb8ec90d973e122046ac32d95cda6c34d7f52bb4;hp=b356033164193c8a900a84b1d0ed1678895d974e;hb=6480e936da257519dd36840862ac995ca8c374da;hpb=1ef49f39828474ed05fe69aff68d400e3b7d4044 diff --git a/src/docs.cpp b/src/docs.cpp index b356033..bb8ec90 100644 --- a/src/docs.cpp +++ b/src/docs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: docs.cpp,v 1.26 2001/02/23 18:56:56 kevin Exp $ +** $Id: docs.cpp,v 1.27 2001/02/23 21:58:31 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -151,39 +151,38 @@ ProjectionFileDocument::~ProjectionFileDocument() { for (BackgroundContainer::iterator i = m_vecpBackgroundSupervisors.begin(); i != m_vecpBackgroundSupervisors.end(); i++) { - (*i)->cancel(); + BackgroundSupervisor::cancelSupervisor(*i); } - m_vecpBackgroundSupervisors.clear(); + while (m_vecpBackgroundSupervisors.size() > 0) + ::wxYield(); + delete m_pProjectionFile; } void ProjectionFileDocument::OnAddBackground (wxCommandEvent& event) { -} + BackgroundSupervisor* pSupervisor = reinterpret_cast(event.GetClientData()); + wxASSERT (pSupervisor != NULL); -void -ProjectionFileDocument::OnRemoveBackground (wxCommandEvent& event) -{ -} - -void -ProjectionFileDocument::addReconstructor (BackgroundSupervisor* pRecon) -{ wxCriticalSectionLocker locker (m_criticalSection); - m_vecpBackgroundSupervisors.push_back (pRecon); + if (pSupervisor) + m_vecpBackgroundSupervisors.push_back (pSupervisor); } void -ProjectionFileDocument::removeReconstructor (BackgroundSupervisor* pRecon) +ProjectionFileDocument::OnRemoveBackground (wxCommandEvent& event) { + BackgroundSupervisor* pSupervisor = reinterpret_cast(event.GetClientData()); + wxASSERT (pSupervisor != NULL); + wxCriticalSectionLocker locker (m_criticalSection); bool bFound = false; for (BackgroundContainer::iterator i = m_vecpBackgroundSupervisors.begin(); i != m_vecpBackgroundSupervisors.end(); i++) - if (*i == pRecon) { + if (*i == pSupervisor) { m_vecpBackgroundSupervisors.erase(i); bFound = true; break;