Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 4 insertions, 5 deletions
-rw-r--r--badwolf.c9
diff --git a/badwolf.c b/badwolf.c
index 58f3962..d4accfe 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -433,13 +433,12 @@ void closeCb_clicked(GtkButton *close, gpointer user_data)
(void)close;
struct Client *browser = (struct Client *)user_data;
GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook);
- GValue *position;
+ GValue position = G_VALUE_INIT;
+ g_value_init (&position, G_TYPE_INT);
- gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", position);
+ gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", &position);
- gint *page_pos = (gint *)g_value_peek_pointer(position);
-
- gtk_notebook_remove_page(notebook, *page_pos);
+ gtk_notebook_remove_page(notebook, g_value_get_int(&position));
free(browser);
}