]> git.lyx.org Git - features.git/commitdiff
Fix memory leak reported by Scott.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 23 Feb 2020 20:54:13 +0000 (15:54 -0500)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:52 +0000 (15:48 +0200)
src/Buffer.cpp

index eb65e811b4588d76aae3a00042a1796de453e4d1..56e19b81be56189141cc7e2ca60f68f3b4bf4ffd 100644 (file)
@@ -545,8 +545,10 @@ Buffer::~Buffer()
                        if (it == cloned_buffers.end()) {
                                // We will leak in this case, but it is safe to continue.
                                LATTEST(false);
-                       } else
+                       } else {
+                               delete(*it);
                                cloned_buffers.erase(it);
+                       }
                        delete d->clone_list_;
                }
                // FIXME Do we really need to do this right before we delete d?