From reading the forum I understand that after using a canvas it should be released. However, I am not sure if that is always the case or whether I can rely on iOS clearing up for me (i.e. relying on ARC). For example:
Is that final c.release required?
If it is, how would I handle the following example where I need to keep the canvas in order to be able to return the bitmap?
I assume I can't release the canvas before the c.CreateBitmap statement?
Also, are there any other structures that have to be treated in this way, e.g bitmaps?
Thanks.
B4X:
Sub doSomethingWithACanvas
Dim c As Canvas
Dim iv As ImageView
iv.Initialize("")
.
.
.
c.Release
End Sub
Is that final c.release required?
If it is, how would I handle the following example where I need to keep the canvas in order to be able to return the bitmap?
B4X:
Sub doSomethingWithACanvas as bitmap
Dim c As Canvas
Dim iv As ImageView
iv.Initialize("")
.
.
.
Return c.CreateBitmap
End Sub
I assume I can't release the canvas before the c.CreateBitmap statement?
Also, are there any other structures that have to be treated in this way, e.g bitmaps?
Thanks.