| | 39 | * test_finalize_stops_timer: |
|---|
| | 40 | * |
|---|
| | 41 | * The objective of this test is to verify that GtkAnimView removes |
|---|
| | 42 | * all its sources that it is using when finalized. The test case |
|---|
| | 43 | * could be a little simpler if #477653 is fixed, but for now, we rely |
|---|
| | 44 | * on brute force and trying to provoke a segfault. |
|---|
| | 45 | **/ |
|---|
| | 46 | static void |
|---|
| | 47 | test_finalize_stops_timer () |
|---|
| | 48 | { |
|---|
| | 49 | printf ("test_finalize_stops_timer\n"); |
|---|
| | 50 | GtkAnimView *aviews[20]; |
|---|
| | 51 | for (int n = 0; n < G_N_ELEMENTS (aviews); n++) |
|---|
| | 52 | { |
|---|
| | 53 | aviews[n] = (GtkAnimView *) gtk_anim_view_new (); |
|---|
| | 54 | g_object_ref (aviews[n]); |
|---|
| | 55 | gtk_object_sink (GTK_OBJECT (aviews[n])); |
|---|
| | 56 | |
|---|
| | 57 | AnimWrapper *aw = anim_wrapper_new (2.0); |
|---|
| | 58 | // Timer starts here |
|---|
| | 59 | gtk_anim_view_set_anim (aviews[n], aw->anim); |
|---|
| | 60 | } |
|---|
| | 61 | for (int n = 0; n < G_N_ELEMENTS (aviews); n++) |
|---|
| | 62 | { |
|---|
| | 63 | gtk_widget_destroy (GTK_WIDGET (aviews[n])); |
|---|
| | 64 | g_object_unref (aviews[n]); |
|---|
| | 65 | } |
|---|
| | 66 | // Timers might run, but object is gnome, leads to segfault. |
|---|
| | 67 | GMainContext *main_ctx = g_main_context_default (); |
|---|
| | 68 | g_usleep (1100 * 1000); |
|---|
| | 69 | g_main_context_iteration (main_ctx, TRUE); |
|---|
| | 70 | } |
|---|
| | 71 | |
|---|
| | 72 | /** |
|---|