Hello!
While integrating SFML (2.5.1) with Qt (5.15.2) in macOS I found that I can't delete an object that inherits from both QWidget and sf::RenderWindow because it crashes. The message the debug console shows before crashing is:
Cannot close SFML area when SFML is integrated in a NSView.
Cannot close SFML area when SFML is integrated in a NSView.
2021-07-29 13:18:42.123407+0200 sfmlqt[79650:1336970] Premature drain of QMacAutoReleasePool(0x7ffee7eab8a8) This can happen if you've allocated the pool on the heap, or as a member of a heap-allocated object. This is not a supported use of QMacAutoReleasePool, and might result in crashes when objects in the pool are deallocated and then used later on under the assumption they will be valid until QMacAutoReleasePool(0x7ffee7eab8a8) has been drained.
I've made a minimal example (see code files attached) in order to reproduce the crash. It is a program with two widgets, the one that inherits from QWidget and sf::RenderWindow (called WindowWidget) and a button that destroys the WindowWidget when it is clicked.
In Windows it works fine.
Am I missing something? Is there a reason I can't delete that object? Is there any workaround?
Thanks in advance