Bug #1126
closedpossible memory leak in WImage::setImageLink with a Resource
0%
Description
Hello!
WFileResource is not deleted if it was used in WImage::setImageLink() method.
However WFileResource's destructor doc says:
"It is up to the user to make sure that the resource is no longer in use (by e.g. a WImage)."
Does this mean that the resource passed to WImage would be deleted with the image?
BR.
Updated by Boris Nagaev almost 13 years ago
Possible work around is to pass some WObject (e.g., the same WImage) in WResource constructor as a parent.
But it doesn't look like true way.
Updated by Koen Deforche almost 13 years ago
- Status changed from New to Feedback
Hey,
A resource can in general be shared by multiple widgets (although indeed that is not a common case).
Memory management for the resource thus either needs to be done manually, or using the normal WObject parent/child relations as you indicate. Why don't you consider it a true way ?
Regards,
koen
Updated by Boris Nagaev almost 13 years ago
Hello!
I didn't know that multiple widgets can own (non-global) resource.
I was confused by "It is up to the user to make sure that the resource is no longer in use (by e.g. a WImage)".
IMHO, documentation should be clarified not to look as if WResource/WFileResource's would not be deleted, if used by WImage::setImageLink().
BR.
Updated by Koen Deforche almost 13 years ago
- Status changed from Feedback to Resolved
Updated by Koen Deforche over 12 years ago
- Status changed from Resolved to Closed
- Target version set to 3.2.1