[gnome-commander] Free unused memory after creating a parent GnomeCmdDir



commit 02abdb4e2b8c92a6ab868b422bfaf7a7e1fad018
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sat Nov 13 22:09:47 2021 +0100

    Free unused memory after creating a parent GnomeCmdDir

 src/gnome-cmd-dir.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index 4d9b89c1..3844381e 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -380,7 +380,11 @@ GnomeCmdDir *gnome_cmd_dir_get_parent (GnomeCmdDir *dir)
 
     GnomeCmdPath *path = dir->priv->path->get_parent();
 
-    return path ? gnome_cmd_dir_new (dir->priv->con, path) : nullptr;
+    auto gnomeCmdDir = path ? gnome_cmd_dir_new (dir->priv->con, path) : nullptr;
+
+    delete path;
+
+    return gnomeCmdDir;
 }
 
 


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