Kaydet (Commit) 02ee2f40 authored tarafından Caolán McNamara's avatar Caolán McNamara

no direct ModelessDialog instantiation left

Change-Id: If31cf3c02ab714f45ebbc0139e0e77102b5eb2ba
Reviewed-on: https://gerrit.libreoffice.org/73342Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c5e383ea
......@@ -188,7 +188,7 @@ class VCL_DLLPUBLIC ModelessDialog : public Dialog
ModelessDialog (const ModelessDialog &) = delete;
ModelessDialog & operator= (const ModelessDialog &) = delete;
public:
protected:
explicit ModelessDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, Dialog::InitFlag eFlag = Dialog::InitFlag::Default );
};
......
......@@ -308,11 +308,11 @@ ways and often both.
Window that has already been destroyed. This can easily
happen via this sort of pattern:
ModelessDialog *pDlg = VclPtr<ModelessDialog>(nullptr /* parent */);
ModalDialog *pDlg = VclPtr<ModalDialog>(nullptr /* parent */);
// by here the pDlg quite probably points to free'd memory...
It is necessary in these cases to ensure that the *pDlg is
a VclPtr<ModelessDialog> instead.
a VclPtr<ModalDialog> instead.
** It crashes with some invalid memory #2...
......
......@@ -299,7 +299,6 @@ void LifecycleTest::testLeakage()
aObjects.push_back(LeakTestObject::Create<VclVButtonBox>(xVBox));
}
aObjects.push_back(LeakTestObject::Create<ModelessDialog>(xParent, "PrintProgressDialog", "vcl/ui/printprogressdialog.ui"));
aObjects.push_back(LeakTestObject::Create<ModalDialog>(xParent, "PrintProgressDialog", "vcl/ui/printprogressdialog.ui"));
xParent.clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment