summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2024-03-19 06:56:14 +0300
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-03-22 10:12:29 +0900
commitb000ed6ad6d2b02a3e8c84675ff1abfa3b3df6ce (patch)
tree0aaaf64d744aebbf666cdfe751afa223063ce9e5
parent32f97849285326896fc6d8cf93b0e8c686804bca (diff)
downloadtqt3-b000ed6ad6d2b02a3e8c84675ff1abfa3b3df6ce.tar.gz
tqt3-b000ed6ad6d2b02a3e8c84675ff1abfa3b3df6ce.zip
TQFileDialog: cleanup pixmaps before destroying TQApplication
Otherwise it results in small memmory leakage on exit of Xlib data. Signed-off-by: Alexander Golubev <fatzer2@gmail.com> (cherry picked from commit fb0d62eec811ab2d4d73550e455944cecbe7e091)
-rw-r--r--src/dialogs/qfiledialog.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dialogs/qfiledialog.cpp b/src/dialogs/qfiledialog.cpp
index 987744d0..085401da 100644
--- a/src/dialogs/qfiledialog.cpp
+++ b/src/dialogs/qfiledialog.cpp
@@ -492,6 +492,10 @@ static TQString toRootIfNotExists( const TQString &path )
return drives->getFirst()->filePath();
}
+static void tqt_do_qfd_cleanup_pixmap() {
+ qfd_cleanup_pixmap.clear();
+}
+
static bool isDirectoryMode( int m )
{
return m == TQFileDialog::Directory || m == TQFileDialog::DirectoryOnly;
@@ -608,6 +612,10 @@ static void makeVariables() {
qfd_cleanup_pixmap.add( &goBackIcon );
fifteenTransparentPixels = new TQPixmap( closedFolderIcon->width(), 1 );
qfd_cleanup_pixmap.add( &fifteenTransparentPixels );
+
+ // On X11 the pixmaps should be cleanup before we disconnect from the server
+ tqAddPostRoutine(&tqt_do_qfd_cleanup_pixmap);
+
TQBitmap m( fifteenTransparentPixels->width(), 1 );
m.fill( TQt::color0 );
fifteenTransparentPixels->setMask( m );