Project

General

Profile

Actions

Bug #1126

closed

possible memory leak in WImage::setImageLink with a Resource

Added by Boris Nagaev over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
01/08/2012
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Boris Nagaev over 12 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.

Actions #2

Updated by Koen Deforche over 12 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

Actions #3

Updated by Boris Nagaev over 12 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.

Actions #4

Updated by Koen Deforche about 12 years ago

  • Status changed from Feedback to Resolved
Actions #5

Updated by Koen Deforche about 12 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.2.1
Actions

Also available in: Atom PDF