/** * Free up pilot file object by releasing internal memory. * \param pilotFile JPilot control data. */ void jpilot_free( JPilotFile *pilotFile ) { g_return_if_fail( pilotFile != NULL ); /* Release custom labels */ jpilot_clear_custom_labels( pilotFile ); /* Clear cache */ addrcache_clear( pilotFile->addressCache ); addrcache_free( pilotFile->addressCache ); /* Free internal stuff */ g_free( pilotFile->path ); pilotFile->file = NULL; pilotFile->path = NULL; pilotFile->readMetadata = FALSE; pilotFile->havePC3 = FALSE; pilotFile->pc3ModifyTime = 0; pilotFile->type = ADBOOKTYPE_NONE; pilotFile->addressCache = NULL; pilotFile->retVal = MGU_SUCCESS; /* Now release file object */ g_free( pilotFile ); }
static void edit_jpilot_read_check_box( JPilotFile *pilotFile ) { gint i; gchar *labelName; jpilot_clear_custom_labels( pilotFile ); for( i = 0; i < JPILOT_NUM_CUSTOM_LABEL; i++ ) { if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(jpilotedit.custom_check[i]) ) ) { labelName = GTK_LABEL(jpilotedit.custom_label[i])->label; jpilot_add_custom_label( pilotFile, labelName ); } } }