diff options
author | Fredrik Orderud <forderud@gmail.com> | 2016-09-14 20:44:52 +0200 |
---|---|---|
committer | Fredrik Orderud <forderud@gmail.com> | 2016-09-15 07:24:29 +0000 |
commit | e8e7a209824d6fb08411981d56ec16cc70af32e2 (patch) | |
tree | 05cb0b27d1f023f87589575f4c02c59c7d7dcd43 /tools | |
parent | 5508cd19d17c2b2a94aef94be2b4dcdbb29377e8 (diff) | |
download | qtactiveqt-e8e7a209824d6fb08411981d56ec16cc70af32e2.tar.gz |
Add menu entry for freeing unused DLLs
The Windows COM runtime uses delay-unloading of unused COM DLLs, with a default
delay of 10min. The new menu entry enables immediate unload of unused COM DLLs,
thus avoiding the need to wait for 10min. This makes it easier to investigate
DLL lifetime issues in ActiveX controls that would otherwise require a 10min
wait after the control have been closed.
Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ms678413.aspx
Change-Id: I48ea7748cc3d976a912f050ccb54c2be4a86486e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testcon/mainwindow.cpp | 10 | ||||
-rw-r--r-- | tools/testcon/mainwindow.h | 2 | ||||
-rw-r--r-- | tools/testcon/mainwindow.ui | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp index 0b0f9fc..bc69264 100644 --- a/tools/testcon/mainwindow.cpp +++ b/tools/testcon/mainwindow.cpp @@ -357,6 +357,16 @@ void MainWindow::on_actionScriptingRun_triggered() #endif } +void MainWindow::on_actionFreeUnusedDLLs_triggered() +{ + // Explicitly unload unused DLLs with no remaining references. + // This is also done automatically after 10min and in low memory situations. + + // must call twice due to DllCanUnloadNow implementation in qaxserverdll + CoFreeUnusedLibrariesEx(0, 0); + CoFreeUnusedLibrariesEx(0, 0); +} + #ifdef QT_NO_QAXSCRIPT static inline void noScriptMessage(QWidget *parent) { diff --git a/tools/testcon/mainwindow.h b/tools/testcon/mainwindow.h index 6f713c7..2c8d687 100644 --- a/tools/testcon/mainwindow.h +++ b/tools/testcon/mainwindow.h @@ -83,6 +83,8 @@ protected slots: void on_actionScriptingLoad_triggered(); void on_actionScriptingRun_triggered(); + void on_actionFreeUnusedDLLs_triggered(); + private: QAxWidget *activeAxWidget() const; QList<QAxWidget *> axWidgets() const; diff --git a/tools/testcon/mainwindow.ui b/tools/testcon/mainwindow.ui index 0320f7f..ad3443c 100644 --- a/tools/testcon/mainwindow.ui +++ b/tools/testcon/mainwindow.ui @@ -364,6 +364,7 @@ <addaction name="actionFreezeEvents" /> <addaction name="actionGroupLogging" /> <addaction name="LoggingMenu" /> + <addaction name="actionFreeUnusedDLLs"/> </widget> <addaction name="FileMenu" /> <addaction name="ContainerMenu" /> @@ -602,6 +603,11 @@ <string>&Run Macro...</string> </property> </action> + <action name="actionFreeUnusedDLLs"> + <property name="text" > + <string>Free Unused DLLs</string> + </property> + </action> <actiongroup name="actionGroupLogging" > <action name="actionLogSignals" > <property name="objectName" > |