From 4274aaed897e713fc628e4dcec93ac6a5f704af0 Mon Sep 17 00:00:00 2001 From: Jaime Resano Date: Fri, 22 Nov 2024 15:51:18 +0100 Subject: 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 Reviewed-by: Friedemann Kleint --- sources/pyside6/doc/tutorials/qmlsqlintegration/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sources/pyside6/doc/tutorials/qmlsqlintegration/main.py') diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py index e42f8f2e9..e514adda8 100644 --- a/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py +++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py @@ -55,5 +55,6 @@ if __name__ == "__main__": if not engine.rootObjects(): sys.exit(-1) - app.exec() + exit_code = app.exec() del engine + sys.exit(exit_code) -- cgit v1.2.3