Menu

#449 Multi-view application terminates when one of the child views with an Irrlicht device is closed

current stable SDK
closed-fixed
None
5
2020-08-11
2020-08-11
No
  • Irrlicht version: 1.8.4 from vcpkg
  • Compiler: Visual C++ 2019

In a multi-view MFC application where one of the views displays an Irrlicht scene, the application exits when this view is closed. We tracked the problem down to CIrrDeviceWin32::closeDevice() that generates the WM_QUIT message by calling PostQuitMessage. In approximately 4 cases out of 5 this message is picked up by the MFC application causing the application to terminate when it should not. The problem can be solved by removing the PostQuitMessage from closeDevice.

There doesn't appear to be a WM_QUIT message handler in the library and I see no reason for posting the message from the library, so I think that posting this message is a bug.

The same code is in CIrrDeviceWinCE. It is also present in the trunk.

Discussion

  • Marko Mahnič

    Marko Mahnič - 2020-08-11

    The call to PostQuitMessage was introduced in r1007 as a fix. It was used in combination with DestroyWindow for destroying the "internal" window. Later external windows were introduced and DestroyWindow was called only for internal windows. But PostQuitMessage was kept for all windows which is probably not correct. The block with message processing should probably be used only for the internal window (patch provided).

     
  • Michael Zeilfelder

    • status: open --> closed-fixed
    • assigned_to: Michael Zeilfelder
     
  • Michael Zeilfelder

    Thanks for finding and even researching where it came from. Explanation sounds likely and I also found not problem in the Win32Window example.
    Fixed now in svn trunk r6135.

     

Log in to post a comment.