Fix issues found by AddressSanitizer

Fix memcpy overlap in TIFF reader.
Fix memory leaks of SpotRows in control spot panel.
Fix memory leaks of SpotRows in locallab.
Fix memory leak of Glib::ThreadPool in file browser entry.
Fix memory leak of Glib::ThreadPool in thumbnail image updater.
This commit is contained in:
Lawrence Lee
2023-11-11 16:56:34 -08:00
parent f93c3ddf94
commit c5bb1f093e
6 changed files with 259 additions and 250 deletions

View File

@@ -18,6 +18,7 @@
*/
#include <atomic>
#include <memory>
#include <set>
#include <gtkmm.h>
@@ -83,10 +84,10 @@ public:
threadCount = omp_get_num_procs();
#endif
threadPool_ = new Glib::ThreadPool(threadCount, 0);
threadPool_.reset(new Glib::ThreadPool(threadCount, 0));
}
Glib::ThreadPool* threadPool_;
std::unique_ptr<Glib::ThreadPool> threadPool_;
// Need to be a std::mutex because used in a std::condition_variable object...
// This is the only exceptions along with GThreadMutex (guiutils.cc), MyMutex is used everywhere else