提交 12a8f548 编写于 作者: A Alexander Alekhin

Merge pull request #6341 from SpecLad:destroy-leak

......@@ -1007,13 +1007,33 @@ static void icvDeleteWindow( CvWindow* window )
}
cvFree( &window );
// if last window...
if( hg_windows == 0 )
{
#ifdef HAVE_GTHREAD
// if last window, send key press signal
// to jump out of any waiting cvWaitKey's
if(hg_windows==0 && thread_started){
g_cond_broadcast(cond_have_key);
}
if( thread_started )
{
// send key press signal to jump out of any waiting cvWaitKey's
g_cond_broadcast( cond_have_key );
}
else
{
#endif
// Some GTK+ modules (like the Unity module) use GDBusConnection,
// which has a habit of postponing cleanup by performing it via
// idle sources added to the main loop. Since this was the last window,
// we can assume that no event processing is going to happen in the
// nearest future, so we should force that cleanup (by handling all pending
// events) while we still have the chance.
// This is not needed if thread_started is true, because the background
// thread will process events continuously.
while( gtk_events_pending() )
gtk_main_iteration();
#ifdef HAVE_GTHREAD
}
#endif
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册