static DFBResult Test_DestroyWindow( IDirectFBDisplayLayer *layer, void *arg ) { IDirectFBWindow *window; D_ASSERT( m_toplevel_id != 0 ); /* * Get the top level window */ _T( layer->GetWindow( layer, arg ? (unsigned long) arg : m_toplevel_id, &window ) ); /* * Destroy it */ SHOW_TEST( "Destroy()..." ); _T( window->Destroy( window ) ); SHOW_RESULT( "...Destroy() done." ); window->Release( window ); return DFB_OK; }
void DFBDeviceScreen::releaseWindow(void* win) { set<IDirectFBWindow*>::iterator i; IDirectFBWindow* w; w = (IDirectFBWindow*)win; pthread_mutex_lock(&winMutex); if (windowPool != NULL) { i = windowPool->find(w); if (i != windowPool->end()) { windowPool->erase(i); pthread_mutex_unlock(&winMutex); } else { pthread_mutex_unlock(&winMutex); } } else { pthread_mutex_unlock(&winMutex); } w->Destroy(w); w->Release(w); win = NULL; w = NULL; }