static void delete_files_cleanup (void)
{
    if (dialog)
        gtk_widget_destroy (dialog);

    for (int i = 0; i < ARRAY_LEN (menus); i ++)
        aud_plugin_menu_remove (menus[i], start_delete);
}
Exemple #2
0
void mtp_cleanup(void)
{
    if (plugin_active)
    {
        aud_plugin_menu_remove (AUD_MENU_MAIN, mtp_press);
        aud_plugin_menu_remove (AUD_MENU_MAIN, free_device);

#if DEBUG
        if(mtp_initialised)
        {
            g_print("\n\n                 !!!CAUTION!!! \n\n"
                    "Cleaning up MTP upload plugin, please wait!!!...\n"
                    "This will block until the pending tracks are uploaded,\n"
                    "then it will gracefully close your device\n\n"
                    "!!! FORCING SHUTDOWN NOW MAY CAUSE DAMAGE TO YOUR DEVICE !!!\n\n\n"
                    "Waiting for the MTP mutex to unlock...\n");
            exiting=TRUE;
        }
#endif
        if(mutex)
            g_mutex_lock(mutex);
        if(mtp_device!= NULL)
        {
            LIBMTP_Release_Device(mtp_device);
            mtp_device = NULL;
        }
        g_mutex_unlock(mutex);
#if DEBUG
        if(mtp_initialised)
            g_print("The MTP mutex has been unlocked\n");
#endif

        g_mutex_free (mutex);
        mutex = NULL;
        plugin_active = FALSE;
#if DEBUG
        if(mtp_initialised)
            g_print("MTP upload plugin has been cleaned up successfully\n");
#endif
    }
}
Exemple #3
0
/*
 * kill the main thread
 */
static void alarm_cleanup(void)
{
    AUDDBG("alarm_cleanup\n");

    aud_plugin_menu_remove (AUD_MENU_MAIN, alarm_configure);

    if (timeout_source)
    {
        g_source_remove (timeout_source);
        timeout_source = 0;
    }

    if (stop.is_valid)
    {
        pthread_cancel(stop.tid);
        stop.is_valid = FALSE;
    }
}
void cd_cleanup (void)
{
    for (gint m = 0; m < N_MENUS; m ++)
        for (gint i = 0; i < N_ITEMS; i ++)
            aud_plugin_menu_remove (menus[m], funcs[i]);
}