aconstlink / motor

Software Framework for Audio/Visual/Interactive Real-Time Applications
MIT License
3 stars 0 forks source link

Deadlock if two windows are used and one is closed #111

Closed aconstlink closed 2 weeks ago

aconstlink commented 2 weeks ago

Randomly occurring bug where application dead locks if one window is closed. Usually this happens, if multiple windows are used.

aconstlink commented 2 weeks ago

It is actually no dead lock but a waiting while loop in the carrier class

while( !ca.shutdown() ) ;

It seems one window does not want to shutdown.

aconstlink commented 2 weeks ago

The problem is in the render engine where one of them or any of them still have commands queued. So if the application shuts down the frame will not be executed so the commands queue will not flush.

Try a force flush or discard of commands.

aconstlink commented 2 weeks ago

So it actually is a dead lock in a render object which is still in use but already released from memory.

This happened because the app class's shutdown function was called although not all windows were closed and shutdown.

So the apps' shutdown function need to wait until all windows are closed so no borrowed pointers are lingering around.