[fpc-pascal] Out of scope method?
ryan at thealchemistguild.com
Thu Apr 6 15:36:42 CEST 2017
> On Apr 6, 2017, at 7:45 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> Arrays are reference counted, class instances are not. So if the compiler would blindly free the instance after it goes out of scope if might free something that another code part still uses.
I was thinking about just calling a method notifying the object it went out of the scope it was declared in. The user could then keep track of ref counting themselves and choose how to handle the case. Personally I want to enable this manually on some objects that I know I didn’t outside of the scope and that would be a handy way to manage this.
More information about the fpc-pascal