Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
HUGE MEMORY LEAK pinpointed!
Der Meister:
Well, this would again put the ownership of the object to the caller as it has to call this certain member function to clean things up. This isn't much different from requiring the caller to delete the FileLoader as soon as it does not need it any more but requires a much more complicated interface.
dmoore:
--- Quote from: Der Meister on June 24, 2007, 05:06:53 pm ---Well, this would again put the ownership of the object to the caller as it has to call this certain member function to clean things up. This isn't much different from requiring the caller to delete the FileLoader as soon as it does not need it any more but requires a much more complicated interface.
--- End quote ---
If the caller is going to process the data they are going to have to take ownership of it (an auto_ptr may help, of course)
I don't think ownership is that big a problem. IMO, the big problem is that you have to wait until a loader is done loading before you can delete it, but the loader doesn't tell you when its done, so you have create messy threads to wait for it. messaging would be the most consistent way of dealing with this (considering CB is a wxwidgets app)
killerbot:
can a loader be queried to check it's state wrt finished loading ?
Der Meister:
I didn't see such a method in its interface but the function to retrieve the data is synchronized with the background-thread (well, what a surprise).
Anyway, I don't see any use from such method. Care to explain?
killerbot:
stupid as it is, query to know when finished so you can delete it
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version