Re: Try/Catch
- Posted by Spock Feb 17, 2015
- 3928 views
Just make sure to wrap the "Get resource" part with a delete_routine() that calls the wrapper for the "Return resource" part.
However, if I only allocate & free the memory inside some routine, making sure not to indadvertently cause a double reference, and if I don't access any Windows stuff or any other DLL stuff, then there will be no problem.
Am I overstating the danger here ?!
Yes, I think so.
So now I have to carefully go through the whole suite of libraries wrapping both get & release calls and replacing those in the code whereever they were called before. And sift through the allocators to make sure there is no inadvertent double reference. And make sure all future modules follow the same bubble-wrapped pattern.
That's a lot of work to do just to protect my programs being bled by your* exceptions.
There just has to be a better way.
Spock
[* plural]