Managing External Objects

BlitzMax Forums/BlitzMax Programming/Managing External Objects

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Epp GMAN, thats a disaster waiting to happen as the object memory was moved to the freelist so although you still are pointing to it major problem.

check out this minor change of variable from local to global. The compiler deals with them differently. Local variables are not refernce counted. They are release by the going out of scope on the Program Stack.

Framework BRL.Blitz

Extern
	Function bbObjectRelease(pBBObject:Object)
EndExtern

Type test
	Field x:Int=5
	Method Delete()
		DebugLog("deleting")
	EndMethod
EndType

Global  mytest:test=New test
bbObjectRelease(mytest)
GCCollect()
DebugLog(mytest.x)
mytest = Null
GCCollect()


As for Gabriels clarification, I think I understand what he wants to do, I just need to noodle on implmentation.

Basically need to create a reference counted intermidary list to manage the Handles. When the handle count is reduced to zero destroy the object in the library.

I'll noodle on it and see if I can produce some code to demonstrate concept. Its hard since I dont have the library in question. What lib is this Gabriel?

Doug Stastny