[loading window] This is nicer than the thread termination. But now we need to find a way to end the load early.

This commit is contained in:
Henrik Andersson
2011-06-07 12:25:29 +02:00
parent e249542093
commit 92c5eaeea0
2 changed files with 2 additions and 8 deletions
+2 -7
View File
@@ -15,7 +15,7 @@
* computer while songs load. */ * computer while songs load. */
REGISTER_SCREEN_CLASS( ScreenReloadSongs ); REGISTER_SCREEN_CLASS( ScreenReloadSongs );
ScreenReloadSongs::ScreenReloadSongs() : loadComplete(false) {} ScreenReloadSongs::ScreenReloadSongs() {}
void ScreenReloadSongs::Init() void ScreenReloadSongs::Init()
{ {
@@ -35,11 +35,7 @@ void ScreenReloadSongs::Init()
ScreenReloadSongs::~ScreenReloadSongs() ScreenReloadSongs::~ScreenReloadSongs()
{ {
if(!loadComplete) { m_loadingThread.Wait();
//we where going to crash if we let this one lose, so "only"
//leaving stuff possibly corrupted isn't worse.
m_loadingThread.Halt(true);
}
RemoveChild(loadWin); RemoveChild(loadWin);
delete loadWin; delete loadWin;
} }
@@ -51,7 +47,6 @@ int ScreenReloadSongs::loadingThreadProc(void *thisAsVoidPtr) {
SONGMAN->Reload( false ); SONGMAN->Reload( false );
SCREENMAN->PostMessageToTopScreen( SM_GoToNextScreen, 0 ); SCREENMAN->PostMessageToTopScreen( SM_GoToNextScreen, 0 );
self->loadComplete=true;
return 0; return 0;
} }
-1
View File
@@ -13,7 +13,6 @@ public:
virtual void Init(); virtual void Init();
~ScreenReloadSongs(); ~ScreenReloadSongs();
private: private:
bool loadComplete;
InGameLoadingWindow *loadWin; InGameLoadingWindow *loadWin;
RageThread m_loadingThread; RageThread m_loadingThread;
static int loadingThreadProc(void *thisAsVoidPtr); static int loadingThreadProc(void *thisAsVoidPtr);