[gnome-commander] Only destroy the delete progress window object if it is not null



commit 8399acaf47288d796085a20be59fc5cecb14088c
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Mon Aug 23 00:26:59 2021 +0200

    Only destroy the delete progress window object if it is not null

 src/dialogs/gnome-cmd-delete-dialog.cc | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-delete-dialog.cc b/src/dialogs/gnome-cmd-delete-dialog.cc
index e17d0281..d7483892 100644
--- a/src/dialogs/gnome-cmd-delete-dialog.cc
+++ b/src/dialogs/gnome-cmd-delete-dialog.cc
@@ -266,8 +266,11 @@ static gboolean update_delete_status_widgets (DeleteData *deleteData)
 {
     g_mutex_lock (&deleteData->mutex);
 
-    gtk_label_set_text (GTK_LABEL (deleteData->proglabel), deleteData->msg);
-    gtk_progress_set_percentage (GTK_PROGRESS (deleteData->progbar), deleteData->progress);
+    if (deleteData->progwin)
+    {
+        gtk_label_set_text (GTK_LABEL (deleteData->proglabel), deleteData->msg);
+        gtk_progress_set_percentage (GTK_PROGRESS (deleteData->progbar), deleteData->progress);
+    }
 
     if (deleteData->problem)
     {
@@ -303,7 +306,10 @@ static gboolean update_delete_status_widgets (DeleteData *deleteData)
             }
         }
 
-        gtk_widget_destroy (deleteData->progwin);
+        if (deleteData->progwin)
+        {
+            gtk_widget_destroy (deleteData->progwin);
+        }
 
         cleanup (deleteData);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]