On 2005/04/01, Thomas Frieden wrote:
I've uploaded a file to the development section's file are (testlib.lha). Note that this is a pretty bad example since it still contains bugs, but I lack the time to come up with a better one.
Many thanks for this and it works
Okey now I have almost used 2 days trying too make my library do that same as you did with little luck :(
Now I have found whats is wrong.. if I calles my main interface "main" I get an extra Obtain() call like this
_main_Obtain() RefCount = 1 _manager_Open() _main_Clone() RefCount = 1 _main_Obtain() RefCount = 2 _main_Clone() RefCount = 1 _main_Obtain() RefCount = 2 _main_Clone() RefCount = 1 _main_Obtain() RefCount = 2 _main_Release() _main_Release() _main_Release() _manager_Close() _manager_Expunge()
Resulting in my RefCount being one highere than it should be and that means my interfaces never gets Expunge()'d, and futher my interface get too calls to free my orginal interface twice meaning an Aleart about mem freed twice guru...
If I rename the interface from "main" to "tmain" like yours every things work nicely no extra Obtain().. see
_manager_Open() _main_Clone() RefCount = 0 _main_Obtain() RefCount = 1 _main_Clone() RefCount = 0 _main_Obtain() RefCount = 1 _main_Clone() RefCount = 0 _main_Obtain() RefCount = 1 _main_Release() _main_Release()->Expunge() _main_Expunge() _main_Release() _main_Release()->Expunge() _main_Expunge() _main_Release() _main_Release()->Expunge() _main_Expunge() _manager_Close() _manager_Expunge()
So that do I do know?
Regards Rene W. Olsen