From cf48eded4dc0e6c860b48a1d756b5920ffc6a724 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 8 May 2012 10:29:45 +0200 Subject: Don't leak native dialog resources Have QDialog::~QDialog() call deleteNativeDialog_sys() on the helpers, so that we don't risk leaking any resources allocated in the helper. QFileDialog does this now, but not QColorDialog or QFontDialog. The Cocoa plugin worked around this problem by calling deleteNativeDialog_sys() itself, but the Windows plugin does not do this, resulting in leaks. Change-Id: I380d87c95686c8f3cb260f9242299be27329280d Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qfiledialog_p.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/widgets/dialogs/qfiledialog_p.h') diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index a66ee757f6..4283842b1d 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -244,7 +244,6 @@ public: // dialog. Returning false means that a non-native dialog must be // used instead. bool canBeNativeDialog(); - void deleteNativeDialog_sys(); QDialog::DialogCode dialogResultCode_sys(); void setDirectory_sys(const QString &directory); @@ -347,15 +346,6 @@ inline QString QFileDialogPrivate::rootPath() const { return model->rootPath(); } -// Dummies for platforms that don't use native dialogs: -inline void QFileDialogPrivate::deleteNativeDialog_sys() -{ - if (QPlatformFileDialogHelper *helper = platformFileDialogHelper()) { - helper->deleteNativeDialog_sys(); - nativeDialogInUse = false; - } -} - inline QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys() { QDialog::DialogCode result = QDialog::Rejected; -- cgit v1.2.3