| 433 } |
433 } |
| 434 |
434 |
| 435 static void |
435 static void |
| 436 destroy_icon_box(PidginStatusBox *statusbox) |
436 destroy_icon_box(PidginStatusBox *statusbox) |
| 437 { |
437 { |
| 438 if (statusbox->icon_box == NULL) |
438 g_clear_pointer(&statusbox->icon_box, gtk_widget_destroy); |
| 439 return; |
439 |
| 440 |
440 g_clear_object(&statusbox->hand_cursor); |
| 441 gtk_widget_destroy(statusbox->icon_box); |
441 g_clear_object(&statusbox->arrow_cursor); |
| 442 |
442 |
| 443 g_object_unref(statusbox->hand_cursor); |
443 g_clear_object(&statusbox->buddy_icon_img); |
| 444 g_object_unref(statusbox->arrow_cursor); |
444 |
| 445 |
445 g_clear_object(&statusbox->buddy_icon); |
| 446 if (statusbox->buddy_icon_img) |
446 g_clear_object(&statusbox->buddy_icon_hover); |
| 447 g_object_unref(statusbox->buddy_icon_img); |
447 |
| 448 |
448 g_clear_pointer(&statusbox->buddy_icon_sel, gtk_widget_destroy); |
| 449 g_object_unref(G_OBJECT(statusbox->buddy_icon)); |
449 |
| 450 g_object_unref(G_OBJECT(statusbox->buddy_icon_hover)); |
450 g_clear_pointer(&statusbox->icon_box_menu, gtk_widget_destroy); |
| 451 |
|
| 452 if (statusbox->buddy_icon_sel) |
|
| 453 gtk_widget_destroy(statusbox->buddy_icon_sel); |
|
| 454 |
|
| 455 if (statusbox->icon_box_menu) |
|
| 456 gtk_widget_destroy(statusbox->icon_box_menu); |
|
| 457 |
451 |
| 458 statusbox->icon = NULL; |
452 statusbox->icon = NULL; |
| 459 statusbox->icon_box = NULL; |
|
| 460 statusbox->icon_box_menu = NULL; |
|
| 461 statusbox->buddy_icon_img = NULL; |
|
| 462 statusbox->buddy_icon = NULL; |
|
| 463 statusbox->buddy_icon_hover = NULL; |
|
| 464 statusbox->hand_cursor = NULL; |
|
| 465 statusbox->arrow_cursor = NULL; |
|
| 466 } |
453 } |
| 467 |
454 |
| 468 static void |
455 static void |
| 469 pidgin_status_box_set_property(GObject *object, guint param_id, |
456 pidgin_status_box_set_property(GObject *object, guint param_id, |
| 470 const GValue *value, GParamSpec *pspec) |
457 const GValue *value, GParamSpec *pspec) |
| 504 break; |
491 break; |
| 505 } |
492 } |
| 506 } |
493 } |
| 507 |
494 |
| 508 static void |
495 static void |
| |
496 pidgin_status_box_dispose(GObject *obj) |
| |
497 { |
| |
498 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj); |
| |
499 |
| |
500 destroy_icon_box(statusbox); |
| |
501 } |
| |
502 |
| |
503 static void |
| 509 pidgin_status_box_finalize(GObject *obj) |
504 pidgin_status_box_finalize(GObject *obj) |
| 510 { |
505 { |
| 511 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj); |
506 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj); |
| 512 gsize i; |
507 gsize i; |
| 513 |
508 |
| 514 purple_signals_disconnect_by_handle(statusbox); |
509 purple_signals_disconnect_by_handle(statusbox); |
| 515 purple_prefs_disconnect_by_handle(statusbox); |
510 purple_prefs_disconnect_by_handle(statusbox); |
| 516 |
|
| 517 destroy_icon_box(statusbox); |
|
| 518 |
511 |
| 519 if (statusbox->active_row) |
512 if (statusbox->active_row) |
| 520 gtk_tree_row_reference_free(statusbox->active_row); |
513 gtk_tree_row_reference_free(statusbox->active_row); |
| 521 |
514 |
| 522 for (i = 0; i < G_N_ELEMENTS(statusbox->connecting_pixbufs); i++) { |
515 for (i = 0; i < G_N_ELEMENTS(statusbox->connecting_pixbufs); i++) { |
| 558 container_class->forall = pidgin_status_box_forall; |
551 container_class->forall = pidgin_status_box_forall; |
| 559 container_class->remove = NULL; |
552 container_class->remove = NULL; |
| 560 |
553 |
| 561 object_class = (GObjectClass *)klass; |
554 object_class = (GObjectClass *)klass; |
| 562 |
555 |
| |
556 object_class->dispose = pidgin_status_box_dispose; |
| 563 object_class->finalize = pidgin_status_box_finalize; |
557 object_class->finalize = pidgin_status_box_finalize; |
| 564 |
558 |
| 565 object_class->get_property = pidgin_status_box_get_property; |
559 object_class->get_property = pidgin_status_box_get_property; |
| 566 object_class->set_property = pidgin_status_box_set_property; |
560 object_class->set_property = pidgin_status_box_set_property; |
| 567 |
561 |