]> uap-core.de Git - mizunara.git/commitdiff
implement mz_files_view_dispose to cleanup child widgets
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 21 Jan 2025 12:39:53 +0000 (13:39 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 21 Jan 2025 12:39:53 +0000 (13:39 +0100)
mizunara/gtk-filesview.c
mizunara/gtk-filesview.h

index 9a80839bc53be3f17043ba21f6ab34a5848c44fc..6a3afe5d1597fb6f941fb0be2c6a753d346c398e 100644 (file)
@@ -57,6 +57,7 @@ static void mz_files_view_class_init(MzFilesViewClass *klass) {
     klass->parent_class.snapshot = mz_files_view_snapshot;
     klass->parent_class.measure = mz_files_view_measure;
     klass->parent_class.size_allocate = mz_files_view_size_allocate;
+    klass->parent_class.parent_class.dispose = mz_files_view_dispose;
 }
 
 static void mz_files_view_init(MzFilesView *self) {
@@ -76,6 +77,11 @@ static void mz_files_view_init(MzFilesView *self) {
     gtk_widget_add_controller(GTK_WIDGET(self), GTK_EVENT_CONTROLLER(drag));
 }
 
+void mz_files_view_dispose(GObject *object) {
+    MzFilesView *view = (MzFilesView*)object;
+    mz_files_view_remove_items(view);
+}
+
 MzFilesView* mz_files_view_new(void) {
     MzFilesView *obj = g_object_new(mz_files_view_get_type(), NULL);
     return obj;
index 1bbd0850880c0947fa3d61643048d50f0e0a7797..30fbb4dafc06879d40cebf95e7cc3e8a0d432f89 100644 (file)
@@ -68,6 +68,8 @@ typedef struct MzFilesViewClass {
 
 MzFilesView* mz_files_view_new(void);
 
+void mz_files_view_dispose(GObject *object);
+
 void mz_files_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot);
 
 void mz_files_view_measure(GtkWidget *widget,