summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-14 12:49:14 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-14 12:18:32 +0000
commitcf11bcd7957eaa8f1665c5237abed9d38f53d241 (patch)
tree510fe114b094828894cf54f6dce15542197b49a9
parent2fc25e72b289b0f8e10110ffa886cad864d3147c (diff)
Fix a crash when overriding QAbstractNativeEventFilter.QAbstractNativeEventFilter()
long * result is nullptr for the custom message WM_USER + 1 internally used by Qt (cf QEventDispatcherWin32::processEvents()). Add a check for that. Amends 899b3cfed8e1c3513f8d3001c53b0bb0cc1af548. Task-number: PYSIDE-790 Change-Id: I4c55cfb17aa95d79f728f43a9030d1f1cbb1d024 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/pyside2/PySide2/templates/core_common.xml6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/templates/core_common.xml b/sources/pyside2/PySide2/templates/core_common.xml
index 4f715ee1..4984cb21 100644
--- a/sources/pyside2/PySide2/templates/core_common.xml
+++ b/sources/pyside2/PySide2/templates/core_common.xml
@@ -278,8 +278,10 @@
if (PySequence_Check(%PYARG_0) &amp;&amp; (PySequence_Size(%PYARG_0) == 2)) {
Shiboken::AutoDecRef pyItem(PySequence_GetItem(%PYARG_0, 0));
%out = %CONVERTTOCPP[bool](pyItem);
- Shiboken::AutoDecRef pyResultItem(PySequence_GetItem(pyResult, 1));
- *result = %CONVERTTOCPP[long](pyResultItem);
+ if (result) {
+ Shiboken::AutoDecRef pyResultItem(PySequence_GetItem(pyResult, 1));
+ *result = %CONVERTTOCPP[long](pyResultItem);
+ }
}
</template>