Details
-
Suggestion
-
Resolution: Out of scope
-
P4: Low
-
4.6.2
-
None
Description
When a QScopedPointer object is destroyed, the cleanup handler is called
even after take() has been called on the scoped pointer.
This constrains any custom cleanup handler to check whether the pointer is null or not.
One could expect to do the following :
struct MyObjectDeleter { static inline void cleanup(MyObject * object) { object->destroy(true); } };
If this behavior can't be changed, maybe the documentation could explicitly state that
null pointers have to be expected when writing a custom cleanup handler.