From e5813d2230105583c5d734cf6808768243d11432 Mon Sep 17 00:00:00 2001 From: Jeremy Borgman Date: Fri, 11 Sep 2020 11:09:21 -0500 Subject: [PATCH] Fixed memory leak and enabled sanatizers --- .gitignore | 3 +++ CMakeLists.txt | 2 +- src/tools/pixelate/pixelatetool.cpp | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b212b0c3..1bcc2140 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,7 @@ data/flatpak/.flatpak-builder # NVIM *~ +# Jetbrains +.idea/ + # End of https://www.gitignore.io/api/snapcraft diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ba8f207..2b44a6e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ include(cmake/CompilerWarnings.cmake) # sanitizer options if supported by compiler include(cmake/Sanitizers.cmake) -# enable_sanitizers(project_options) +enable_sanitizers(project_options) # allow for static analysis options include(cmake/StaticAnalyzers.cmake) diff --git a/src/tools/pixelate/pixelatetool.cpp b/src/tools/pixelate/pixelatetool.cpp index ff0389ec..9b430a2d 100644 --- a/src/tools/pixelate/pixelatetool.cpp +++ b/src/tools/pixelate/pixelatetool.cpp @@ -139,6 +139,8 @@ PixelateTool::process(QPainter& painter, const QPixmap& pixmap, bool recordUndo) scene.addPixmap(result); scene.render(&painter, selection, QRectF()); + + delete source; } void