The container for temp files to be removed was a vector, but it needed stable member addresses. make it a list

This commit is contained in:
Jean-Francois Dockes 2019-06-27 11:12:01 +02:00
parent 59f6c503cb
commit 0a460ea9c6

View File

@ -17,6 +17,7 @@
#include "autoconfig.h"
#include <cstdlib>
#include <list>
#include <qapplication.h>
#include <qtranslator.h>
@ -50,7 +51,9 @@
extern RclConfig *theconfig;
std::mutex thetempfileslock;
static vector<TempFile> o_tempfiles;
// Use a list not a vector so that contained objects have stable
// addresses when extending.
static list<TempFile> o_tempfiles;
/* Keep an array of temporary files for deletion at exit. It happens that we
erase some of them before exiting (ie: when closing a preview tab), we don't
reuse the array holes for now */