Possible memory leak on drag
Posted: Tue Feb 09, 2016 1:24 pm
I seem to be getting a memory leak (about 1 MB) when dragging an image (LiveCode 7.1.1) using code
on dragStart
....
put the long ID of the target into tObj
export snapshot from tObj to tVar as PNG
set the width of img "DragImage" to the width of tObj
set the height of img "DragImage" to the height of tObj
set the visible of image "DragImage" to false
put tVar into img "DragImage"
put the clickH - the left of the target into xOffset
put the clickV - the top of the target into yOffset
set the dragImageOffset to xOffset,yOffset
set the dragImage to the short id of img "DragImage"
set the dragData["private"] to gridCoords(item 1 of the loc of the target,item 2 of the loc of the target)
---
dragMove does nothing unusual, just sets the dragAction to either "none" or "move"
There is also an Xcode console message
LiveCode-Community[13158:1963210] _DPSDiscardEvents: FlushEventsMatchingListFromQueue returned error (-50)
which appears at the start of the drag (possibly indicating an event reference being lost?) I was debugging an external when I found this - the external is not being called when the leak and console message occur however.
Any ideas?
on dragStart
....
put the long ID of the target into tObj
export snapshot from tObj to tVar as PNG
set the width of img "DragImage" to the width of tObj
set the height of img "DragImage" to the height of tObj
set the visible of image "DragImage" to false
put tVar into img "DragImage"
put the clickH - the left of the target into xOffset
put the clickV - the top of the target into yOffset
set the dragImageOffset to xOffset,yOffset
set the dragImage to the short id of img "DragImage"
set the dragData["private"] to gridCoords(item 1 of the loc of the target,item 2 of the loc of the target)
---
dragMove does nothing unusual, just sets the dragAction to either "none" or "move"
There is also an Xcode console message
LiveCode-Community[13158:1963210] _DPSDiscardEvents: FlushEventsMatchingListFromQueue returned error (-50)
which appears at the start of the drag (possibly indicating an event reference being lost?) I was debugging an external when I found this - the external is not being called when the leak and console message occur however.
Any ideas?