Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
Description
QSharedPointer does not work in all cases with forward-declared pointers. It needs access to the full declaration at every point where the last reference could be dropped. That is to say, at every point where any reference could be dropped.
The following code, for example, might be undefined behaviour:
class Foo;
QSharedPointer<Foo> ptr = getFooSharedPointer();
ptr.clear();
QSharedPointer should record the deleter function from the point where the pointer was constructed.