void menu_entry_unref(ObMenuEntry *self) { if (self && --self->ref == 0) { switch (self->type) { case OB_MENU_ENTRY_TYPE_NORMAL: RrImageUnref(self->data.normal.icon); g_free(self->data.normal.label); while (self->data.normal.actions) { actions_act_unref(self->data.normal.actions->data); self->data.normal.actions = g_slist_delete_link(self->data.normal.actions, self->data.normal.actions); } break; case OB_MENU_ENTRY_TYPE_SUBMENU: g_free(self->data.submenu.name); break; case OB_MENU_ENTRY_TYPE_SEPARATOR: g_free(self->data.separator.label); break; } g_slice_free(ObMenuEntry, self); } }
static void actions_interactive_end_act(void) { syslog(LOG_INFO,"end act"); if (interactive_act) { ungrab_keyboard(); syslog(LOG_INFO,"end act if"); actions_act_unref(interactive_act); interactive_act = NULL; } }
static void actions_interactive_end_act(void) { if (interactive_act) { ObActionsAct *ia = interactive_act; /* set this to NULL first so the i_post() function can't cause this to get called again (if it decides it wants to cancel any ongoing interactive action). */ interactive_act = NULL; ungrab_keyboard(); if (ia->i_post) ia->i_post(ia->options); actions_act_unref(ia); } }
void tree_destroy(KeyBindingTree *tree) { KeyBindingTree *c; while (tree) { tree_destroy(tree->next_sibling); c = tree->first_child; if (c == NULL) { GList *it; GSList *sit; for (it = tree->keylist; it != NULL; it = it->next) g_free(it->data); g_list_free(tree->keylist); for (sit = tree->actions; sit != NULL; sit = sit->next) actions_act_unref(sit->data); g_slist_free(tree->actions); } g_free(tree); tree = c; } }
void mouse_unbind_all(void) { gint i; GSList *it; for(i = 0; i < OB_FRAME_NUM_CONTEXTS; ++i) { for (it = bound_contexts[i]; it; it = g_slist_next(it)) { ObMouseBinding *b = it->data; gint j; for (j = 0; j < OB_NUM_MOUSE_ACTIONS; ++j) { GSList *jt; for (jt = b->actions[j]; jt; jt = g_slist_next(jt)) actions_act_unref(jt->data); g_slist_free(b->actions[j]); } g_free(b); } g_slist_free(bound_contexts[i]); bound_contexts[i] = NULL; } }