mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Fix crash on exit T3D when build with CMake.
Process::_signalProcess is destroyed first, and then Win32WindowManager::~Win32WindowManager() try to remove from deleted Signal causing a crash. SlotSignal handle this automatically.
This commit is contained in:
parent
0137c86765
commit
881d578aae
3 changed files with 9 additions and 4 deletions
|
|
@ -96,6 +96,11 @@ public:
|
||||||
get()._signalProcess.notify(del,order);
|
get()._signalProcess.notify(del,order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void notify(SignalSlot<void()> &slot, F32 order = PROCESS_DEFAULT_ORDER)
|
||||||
|
{
|
||||||
|
get()._signalProcess.notify(slot,order);
|
||||||
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
static void notify(T func, F32 order = PROCESS_DEFAULT_ORDER)
|
static void notify(T func, F32 order = PROCESS_DEFAULT_ORDER)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@ PlatformWindowManager * CreatePlatformWindowManager()
|
||||||
Win32WindowManager::Win32WindowManager()
|
Win32WindowManager::Win32WindowManager()
|
||||||
{
|
{
|
||||||
// Register in the process list.
|
// Register in the process list.
|
||||||
Process::notify(this, &Win32WindowManager::_process, PROCESS_INPUT_ORDER);
|
mOnProcessSignalSlot.setDelegate( this, &Win32WindowManager::_process );
|
||||||
|
Process::notify( mOnProcessSignalSlot, PROCESS_INPUT_ORDER );
|
||||||
|
|
||||||
// Init our list of allocated windows.
|
// Init our list of allocated windows.
|
||||||
mWindowListHead = NULL;
|
mWindowListHead = NULL;
|
||||||
|
|
@ -58,9 +59,6 @@ Win32WindowManager::Win32WindowManager()
|
||||||
|
|
||||||
Win32WindowManager::~Win32WindowManager()
|
Win32WindowManager::~Win32WindowManager()
|
||||||
{
|
{
|
||||||
// Get ourselves off the process list.
|
|
||||||
Process::remove(this, &Win32WindowManager::_process);
|
|
||||||
|
|
||||||
// Kill all our windows first.
|
// Kill all our windows first.
|
||||||
while(mWindowListHead)
|
while(mWindowListHead)
|
||||||
// The destructors update the list, so this works just fine.
|
// The destructors update the list, so this works just fine.
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,8 @@ class Win32WindowManager : public PlatformWindowManager
|
||||||
/// If a curtain window is present, then its HWND will be stored here.
|
/// If a curtain window is present, then its HWND will be stored here.
|
||||||
HWND mCurtainWindow;
|
HWND mCurtainWindow;
|
||||||
|
|
||||||
|
SignalSlot<void()> mOnProcessSignalSlot;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Win32WindowManager();
|
Win32WindowManager();
|
||||||
~Win32WindowManager();
|
~Win32WindowManager();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue