Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Resano <Jaime.Resano-Aisa@qt.io>2024-11-22 15:51:18 +0100
committerJaime Resano <Jaime.RESANO-AISA@qt.io>2024-11-25 11:11:46 +0000
commit4274aaed897e713fc628e4dcec93ac6a5f704af0 (patch)
treed19345c8d515988857fb78a3f6d203b00cd23a1f /sources/pyside-tools/qml.py
parent78ac4b40a5da489036885def98e5108fdd56cdbc (diff)
Delete QQmlApplicationEngine on application exit
Due to the API limitations, we have to ensure that the engine is deleted before other parts of the application is deleted. Otherwise exposing objects using setInitialProperties() or setContextProperty() for example will cause warnings to be printed. It is a good practice to always delete the engine manually so all the code should be consistent. Task-number: PYSIDE-1612 Pick-to: 6.8 Change-Id: I01f16359e9d90cefd5957708fe12ce489bd7edc0 Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/qml.py')
-rw-r--r--sources/pyside-tools/qml.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/pyside-tools/qml.py b/sources/pyside-tools/qml.py
index d36e86347..f138d2e7e 100644
--- a/sources/pyside-tools/qml.py
+++ b/sources/pyside-tools/qml.py
@@ -243,4 +243,6 @@ if __name__ == "__main__":
if args.config == "resizeToItem":
logging.info("qml: Not a QQuickview item. resizeToItem is done by default")
- sys.exit(app.exec())
+ exit_code = app.exec()
+ del engine
+ sys.exit(exit_code)