4018787...
by
Cristian Maureira-Fredes <email address hidden>
Revert QAbstractVideoSurface patch
This will re-open PYSIDE-794,
but it was a wrong solution that was breaking
the other setVideoOutput signatures, causing a sefault
on the `player` example.
QIODevice bindings: Fix invalid reads in read() functions
When running test in debug mode on Windows, failures occurred:
File "sources/pyside2/tests/QtCore/qfileread_test.py", line 41, in readData
return super(FileChild2, self).readData(maxlen)
UnicodeDecodeError 'utf-8' codec can't decode byte 0xcd in position 21: invalid continuation byte
File "C:/dev/pyside/pyside-setup511d/sources/pyside2/tests/QtCore/qfile_test.py", line 57, in testBasic
self.assertFalse(obj.getChar()[0])
UnicodeDecodeError 'utf-8' codec can't decode byte 0xcc in position 0: unexpected end of data
This is caused by missing initializers and terminating \0 characters in the
QByteArrays introduced by ca806b438e8a27dc4562ac806d189765e93e09e5, unearthed
by MSVC helpfully filling unitinialized data with random values.
Fix by using a QByteArray of size n + 1 filled with 0.
Initialize the character variable in the fix_char* template.
Task-number: PYSIDE-40
Change-Id: Ia604841a89f1b1b9564c16d2f23cd9f7c20f5628
Reviewed-by: Alexandru Croitor <email address hidden>
Fix Memory Leak Caused By Wrong Limited API Default
When a type has nullptr as tp_dealloc, there apply different defaults.
Static types had object_dealloc as default, while new heaptypes
created with type_new have subtype_dealloc as default.
A problem was now that PyType_FromSpec also has
subtype_dealloc as default. But that is wrong, because a type that
was written with the static type approach is already written with
object_dealloc in mind and takes somehow care about further issues
with that type.
When we now convert this type and suddenly use subtype_dealloc
instead of object_dealloc, things get pretty wrong.
Finding that out was pretty hard and took quite long to understand.
The fix was then very easy and is the best proof:
Replacing our former (wrong) solution of supplying an
SbkDummyDealloc with a function object_dealloc works perfectly,
and the leakage completely vanished.