From 36c70c0cda698bd3428d727d06fd7aa441639af8 Mon Sep 17 00:00:00 2001 From: yvt Date: Sat, 7 Sep 2013 20:47:07 +0900 Subject: [PATCH] Fixed a bug that caused crash with cg_smp --- Sources/Client/AsyncRenderer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Client/AsyncRenderer.cpp b/Sources/Client/AsyncRenderer.cpp index 4e77a65d..e8d7f8f4 100644 --- a/Sources/Client/AsyncRenderer.cpp +++ b/Sources/Client/AsyncRenderer.cpp @@ -131,6 +131,8 @@ namespace spades { return this; }else{ arenderer->deletedModels.push_back(model); + locker.Release(); + mutex.Unlock(); delete this; return NULL; } @@ -446,6 +448,7 @@ namespace spades { std::map::iterator it = images.find(filename); if(it == images.end()) { + FlushCommands(); RegisterImageDispatch dispatch(base, filename); dispatch.StartOn(queue); dispatch.Join(); @@ -488,6 +491,7 @@ namespace spades { } }; + FlushCommands(); CreateImageDispatch dispatch(base, bmp); dispatch.StartOn(queue); dispatch.Join(); @@ -525,6 +529,7 @@ namespace spades { std::map::iterator it = models.find(filename); if(it == models.end()) { + FlushCommands(); RegisterModelDispatch dispatch(base, filename); dispatch.StartOn(queue); dispatch.Join(); @@ -562,6 +567,7 @@ namespace spades { } }; + FlushCommands(); CreateModelDispatch dispatch(base, bmp); dispatch.StartOn(queue); dispatch.Join();