X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fplugins%2Ftest.c;h=8d12dc1172faec9fe1736cc3b919af511077c821;hp=a463d3a6551661925e24adc182fc418f7965fe0d;hb=67a63167629adc48ff31530dd58ece577f3d7460;hpb=a9f70646cc15a7113ee632e8ddd6c6ad77efb68b diff --git a/src/plugins/test.c b/src/plugins/test.c index a463d3a..8d12dc1 100644 --- a/src/plugins/test.c +++ b/src/plugins/test.c @@ -65,9 +65,9 @@ static gboolean on_poly_key(GritsPoly *poly, GdkEventKey *event) { g_debug("GritsPluginTest: on_poly_key - %d", event->keyval); gdouble colors[0xff][3] = { - [GDK_r] {1, 0, 0}, - [GDK_g] {0, 1, 0}, - [GDK_b] {0, 0, 1}, + [GDK_KEY_r] {1, 0, 0}, + [GDK_KEY_g] {0, 1, 0}, + [GDK_KEY_b] {0, 0, 1}, }; if (event->keyval >= G_N_ELEMENTS(colors)) return FALSE; @@ -175,11 +175,12 @@ static void grits_plugin_test_dispose(GObject *_test) g_debug("GritsPluginTest: dispose"); GritsPluginTest *test = GRITS_PLUGIN_TEST(_test); if (test->viewer) { - grits_viewer_remove(test->viewer, GRITS_OBJECT(test->marker)); - grits_viewer_remove(test->viewer, GRITS_OBJECT(test->poly)); - grits_viewer_remove(test->viewer, GRITS_OBJECT(test->line)); - g_object_unref(test->viewer); + GritsViewer *viewer = test->viewer; test->viewer = NULL; + grits_object_destroy_pointer(&test->marker); + grits_object_destroy_pointer(&test->poly); + grits_object_destroy_pointer(&test->line); + g_object_unref(viewer); } G_OBJECT_CLASS(grits_plugin_test_parent_class)->dispose(_test); }