Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.9.3
-
None
Description
Hi,
we are facing the issue already mentionned in https://bugreports.qt.io/browse/QTBUG-37395.
Basically, we use our own memory allocation routines, overriding the global and delete operators (common practise in game/3d industry).
Now, since QList is a template class, some of the implementation is duplicated in Qt DLLS and client code. However, this leads to a mismatch between the new/delete functions linked in Qt DLLs and the ones linked in our client code.
The issue is, when a QList object is created in Qt DLLs and destroyed in the client code (used quite often): memory is allocated in Qt DLL (using standard new/delete) but deallocated in our client code (using modified new/delete), leading to a crash.
A solution would be to have all Qt-allocated memory allocated AND destroy in the same location (i.e. Qt DLL).
Another option would be to not rely on global new/delete operator, but rather on routines that can't be overriden by users (internal Qt allocator for instance), and whose implementation is located in Qt DLL ONLY (as opposed to client code as well, which is the case at the moment).
This is a real critical flaw as far as I am concerned...
Thanks for reading.
Regards,
Gregory
Attachments
Issue Links
- relates to
-
QTBUG-37395 QList's inline use of new and delete can cause memory errors
-
- Closed
-