Changes between Initial Version and Version 1 of Ticket #2427, comment 20


Ignore:
Timestamp:
Sep 27, 2014, 9:49:12 AM (10 years ago)
Author:
historic_bruno

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2427, comment 20

    initial v1  
    1 I think the problem starting Atlas from the in-game menu is due to SDL having a similar init process to wxWidgets. There is an SDLApplication subclass of [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html NSApplication], like the wxNSApplication subclass for wxWidgets. Calling the [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/occ/clm/NSApplication/sharedApplication sharedApplication] method the first time initializes a global instance of that class, after that it returns a reference to it. It seems the instance is still active after the engine restarts and wxWidgets tries to do its own init process, but it won't init an wxNSApplication, only return a reference to the `SDLApplication`.
     1I think the problem starting Atlas from the in-game menu is due to SDL having a similar init process to wxWidgets. There is an `SDLApplication` subclass of [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html NSApplication], like the `wxNSApplication` subclass for wxWidgets. Calling the [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/occ/clm/NSApplication/sharedApplication sharedApplication] method the first time initializes a global instance of that class, after that it returns a reference to it. It seems the instance is still active after the engine restarts and wxWidgets tries to do its own init process, but it won't init an `wxNSApplication`, only return a reference to the existing `SDLApplication`.
    22
    33trompetin17's patch should work around that by not calling `OnInitGui()` and the use of `wxEntryStart` will avoid some other init code as well, I'm not certain on the other effects of this. It would be ideal if we could shutdown the global `SDLApplication` and then do normal wxWidgets init.