X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fthreadraster.cpp;h=8a93facb5538ad2025e09cba70ac39a76562b878;hb=b4f2d26b8657e786cecf339a13fe8e53c2a0e6b5;hp=3b90791c4b2275bfd6c4910b103fdb5f97c540c6;hpb=cd93aebb4dec4e0ae88d53f131c2320ae92d0cab;p=ctsim.git diff --git a/src/threadraster.cpp b/src/threadraster.cpp index 3b90791..8a93fac 100644 --- a/src/threadraster.cpp +++ b/src/threadraster.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadraster.cpp,v 1.8 2001/03/04 22:30:20 kevin Exp $ +** $Id: threadraster.cpp,v 1.11 2001/03/05 20:29:23 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 @@ -65,31 +65,27 @@ RasterizerSupervisorThread::RasterizerSupervisorThread (PhantomFileView* pProjVi wxThread::ExitCode RasterizerSupervisorThread::Entry() { - RasterizerSupervisor* pRasterSupervisor = new RasterizerSupervisor (this, m_pPhantomView, m_iNX, m_iNY, m_iNSample, m_dViewRatio, m_strLabel.c_str()); + RasterizerSupervisor rasterSupervisor (this, m_pPhantomView, m_iNX, m_iNY, m_iNSample, m_dViewRatio, m_strLabel.c_str()); - pRasterSupervisor->start(); + rasterSupervisor.start(); - while (! pRasterSupervisor->workersDone() && ! pRasterSupervisor->fail() && ! pRasterSupervisor->cancelled()) { + while (! rasterSupervisor.workersDone() && ! rasterSupervisor.fail() && ! rasterSupervisor.cancelled()) { Sleep(100); } - if (pRasterSupervisor->fail()) + if (rasterSupervisor.fail()) { wxString msg ("Error starting Rasterizer supervisor: "); - msg += pRasterSupervisor->getFailMessage().c_str(); + msg += rasterSupervisor.getFailMessage().c_str(); msg += "\n"; wxCommandEvent eventLog (wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT ); eventLog.SetString( msg ); wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event } - if (! pRasterSupervisor->cancelled()) - pRasterSupervisor->onDone(); - pRasterSupervisor->deleteWorkers(); - while (! pRasterSupervisor->workersDeleted()) { - Sleep(50); - } - delete pRasterSupervisor; + if (! rasterSupervisor.cancelled()) + rasterSupervisor.onDone(); + rasterSupervisor.deleteWorkers(); return reinterpret_cast(0); }