diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-10-15 22:35:38 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-04-10 23:51:36 +0300 |
commit | 19347f7094c9448e02a021ae2d571b5fe8bfcc2e (patch) | |
tree | 870e4ca00ddb761b19644bca96b0630710d172fa /indra/llwindow | |
parent | d53183557d6f4bfc3ead9b12b6d327b37e852faf (diff) |
Fix merge issues:
* Restore changes from 21947778baaca205615a71a97ac8f563c998fdd3 to llwindow/llwindowwin32.cpp
* Restore changes from 3758618949684641fc94b5c9478d9002706213cc to newview/llinspecttexture.cpp
* Fix apparent merge error in LLInventoryPanel::itemChanged
* Restore changes from 1eeecfa1a8bf43a8980217ce34e3b5f4458483e0 in newview/llpaneloutfitsinventory.h
* Restore changes from b9633c17e373bfe55b29228996e8473eb041466d in newview/llpaneloutfitsinventory.h & newview/llpanelwearing.cpp
* Restore changes from f660f1f0fda4d2363d351fa550b4f8818b46c2c3 in newview/llviewertexture.cpp
* Restore changes from b9633c17e373bfe55b29228996e8473eb041466d & 98f7d73d46fdc045759023eda6409e8c791f5cb2 in newview/lloutfitgallery.cpp and newview/lloutfitslist.cpp
* Replace changes from 23729442aab7130f3368d433e8a5a9dd45ff6b98 with current implementation in develop branch
* Fix more broken changes in LLViewerTexture::saveRawImage
* Restore the changes in LLMath both from develop and maint-c
* Fix all kind of other merge errors
# Conflicts:
# indra/llmath/v2math.h
# indra/llmath/v3math.h
# indra/llui/llfolderviewitem.cpp
# indra/llwindow/llwindowwin32.cpp
# indra/newview/llfloaterobjectweights.h
# indra/newview/lloutfitgallery.cpp
# indra/newview/lloutfitslist.cpp
# indra/newview/llsidepaneliteminfo.cpp
# indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 6ce0594c96..6fad11d506 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -410,7 +410,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 bool mGLReady = false; bool mGotGLBuffer = false; - LLAtomicBool mDeleteOnExit = false; + bool mDeleteOnExit = false; }; @@ -4852,6 +4852,15 @@ bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() mGLReady = false; }); + mDeleteOnExit = true; + SetWindowLongPtr(old_handle, GWLP_USERDATA, NULL); + + // Let thread finish on its own and don't block main thread. + for (auto& pair : mThreads) + { + pair.second.detach(); + } + LL_DEBUGS("Window") << "Closing window's pool queue" << LL_ENDL; mQueue->close(); @@ -4866,47 +4875,6 @@ bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() PostMessage(old_handle, WM_DUMMY_, wparam, 0x1337); } - // There are cases where window will refuse to close, - // can't wait forever on join, check state instead - LLTimer timeout; - timeout.setTimerExpirySec(2.0); - while (!getQueue().done() && !timeout.hasExpired() && mWindowHandleThrd) - { - ms_sleep(100); - } - - if (getQueue().done() || mWindowHandleThrd == NULL) - { - // Window is closed, started closing or is cleaning up - // now wait for our single thread to die. - if (mWindowHandleThrd) - { - LL_INFOS("Window") << "Window is closing, waiting on pool's thread to join, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL; - } - else - { - LL_DEBUGS("Window") << "Waiting on pool's thread, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL; - } - for (auto& pair : mThreads) - { - pair.second.join(); - } - } - else - { - // Something suspended window thread, can't afford to wait forever - // so kill thread instead - // Ex: This can happen if user starts dragging window arround (if it - // was visible) or a modal notification pops up - LL_WARNS("Window") << "Window is frozen, couldn't perform clean exit" << LL_ENDL; - - for (auto& pair : mThreads) - { - // very unsafe - TerminateThread(pair.second.native_handle(), 0); - pair.second.detach(); - } - } LL_DEBUGS("Window") << "thread pool shutdown complete" << LL_ENDL; return true; } |