imgA is int. with a call to imagecreate(). Then imgB = imgA.
The pointers are both pointing to the same memory.
imageDestroy() is called on imgA supposedly deallocating that memory.
At this point shouldn't imgB be pointing to deallocated memory?
imageInfo(imgB) returns a valid image, at the very same memory.
Has anything been deallocated?
Code: Select all
ScreenRes 800, 600, 32
Dim As Any Ptr imgA, imgB
imgA = ImageCreate(100,100,,32)
Line imgA,(0,0)-Step(99,99), RGB(0,255,0)
Put (0,0), imgA, Trans
imgB = imgA
Put (20,0), imgB, Trans
? ImageInfo(imgA), ImageInfo(imgB), imgA, imgB
ImageDestroy(imgA)
imgA = 0
Put(40,0), imgB, Trans
? ImageInfo(imgA), ImageInfo(imgB), imgA, imgB
sleep