Crash debug build if to delete object, which sent 'play_animation' (DEF-2179) (SOLVED)

Example with crash:

    local id = factory.create('#factory', position)
    local sprite_url = msg.url(nil, id, 'sprite')
    msg.post(sprite_url, 'play_animation', { id = hash('anim') })
    go.delete()

Example without crash:

    local id = factory.create('#factory', position)
    local sprite_url = msg.url(nil, id, 'sprite')
    msg.post(sprite_url, 'play_animation', { id = hash('anim') })
    -- go.delete()

Do you get anything in the console?

Correction: there is a crash after animation is done, not after deleting of factory-object

Nope:
screenshot

I was not able to reproduce this.

Here is a give quick overview of my setup, please point out any difference:

main.collection

  • main.go
    • main.script
    • factory: /tmp.go

tmp.go

  • sprite, animation: test1 using tmp.atlas (has images; [test1, test2] )

main.script

local position = vmath.vector3(100, 100, 0)
local id = factory.create('#factory', position)
local sprite_url = msg.url(nil, id, 'sprite')
msg.post(sprite_url, 'play_animation', { id = hash('test2') })
go.delete()

This results in the sprite changing image (/animation) to test2 and the main.go being deleted.

The animation (test2) must ends after deleting go. I think, in your case image can change before deleting. In my case animation has duration at least 1-2 seconds.

1 Like

Changed so the animation now lasts 4 seconds, still no crash. :confused:

Could you reproduce the crash in a small project and upload it here?

test.zip (11.2 KB)

where /test/test.collection as main collection

2 Likes

Thanks that helped! I have added an issue for this: DEF-2179

3 Likes

I’m going through old issues in our system and I’m not able to get this to crash using the most recent editor and engine. I’m closing this until someone else reports that it’s still a problem.

3 Likes