static void Close( vlc_object_t *p_this ) { intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_sys_t *p_sys = p_intf->p_sys; if( !p_sys->b_isDialogProvider ) { playlist_t *pl = THEPL; var_Destroy (pl, "window"); var_Destroy (pl, "qt4-iface"); playlist_Deactivate (pl); /* release window provider if needed */ } /* And quit */ msg_Dbg( p_this, "requesting exit..." ); QVLCApp::triggerQuit(); msg_Dbg( p_this, "waiting for UI thread..." ); #ifndef Q_OS_MAC vlc_join (p_sys->thread, NULL); #endif delete p_sys; QMutexLocker locker (&lock); assert (busy); busy = false; }
//--------------------------------------------------------------------------- // Close: destroy interface //--------------------------------------------------------------------------- static void Close( vlc_object_t *p_this ) { intf_thread_t *p_intf = (intf_thread_t *)p_this; msg_Dbg( p_intf, "closing skins2 module" ); /* Terminate input to ensure that our window provider is released. */ playlist_Deactivate( p_intf->p_sys->p_playlist ); vlc_mutex_lock( &skin_load.mutex ); skin_load.intf = NULL; vlc_mutex_unlock( &skin_load.mutex); AsyncQueue *pQueue = p_intf->p_sys->p_queue; if( pQueue ) { CmdGeneric *pCmd = new CmdExitLoop( p_intf ); if( pCmd ) pQueue->push( CmdGenericPtr( pCmd ) ); } else { msg_Err( p_intf, "thread found already stopped (weird!)" ); } vlc_join( p_intf->p_sys->thread, NULL ); vlc_mutex_destroy( &p_intf->p_sys->init_lock ); vlc_cond_destroy( &p_intf->p_sys->init_wait ); // Destroy structure free( p_intf->p_sys ); }
/** * Destroy playlist. * This is not thread-safe. Any reference to the playlist is assumed gone. * (In particular, all interface and services threads must have been joined). * * \param p_playlist the playlist object */ void playlist_Destroy( playlist_t *p_playlist ) { playlist_private_t *p_sys = pl_priv(p_playlist); /* Remove all services discovery */ playlist_ServicesDiscoveryKillAll( p_playlist ); msg_Dbg( p_playlist, "destroying" ); playlist_Deactivate( p_playlist ); if( p_sys->p_preparser ) playlist_preparser_Delete( p_sys->p_preparser ); /* Release input resources */ assert( p_sys->p_input == NULL ); input_resource_Release( p_sys->p_input_resource ); if( p_playlist->p_media_library != NULL ) playlist_MLDump( p_playlist ); PL_LOCK; /* Release the current node */ set_current_status_node( p_playlist, NULL ); /* Release the current item */ set_current_status_item( p_playlist, NULL ); PL_UNLOCK; vlc_cond_destroy( &p_sys->signal ); vlc_mutex_destroy( &p_sys->lock ); /* Remove all remaining items */ FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->all_items ) free( p_del->pp_children ); vlc_gc_decref( p_del->p_input ); free( p_del ); FOREACH_END(); ARRAY_RESET( p_playlist->all_items ); FOREACH_ARRAY( playlist_item_t *p_del, p_sys->items_to_delete ) free( p_del->pp_children ); vlc_gc_decref( p_del->p_input ); free( p_del ); FOREACH_END(); ARRAY_RESET( p_sys->items_to_delete ); ARRAY_RESET( p_playlist->items ); ARRAY_RESET( p_playlist->current ); vlc_http_cookie_jar_t *cookies = var_GetAddress( p_playlist, "http-cookies" ); if ( cookies ) { var_Destroy( p_playlist, "http-cookies" ); vlc_http_cookies_destroy( cookies ); } vlc_object_release( p_playlist ); }