danishcake / Shoko-Rocket

A clone of Chu Chu Rocket
3 stars 1 forks source link

SDLGUIlib - Widgets cannot be created from callbacks #15

Closed danishcake closed 14 years ago

danishcake commented 14 years ago

Widgets cannot be created from callbacks as they invalidate the interators. Should add them to temporary lists that are merged on Tick()

danishcake commented 14 years ago

Also cannot be destroyed. It's a bit tricky to workaround, as the internal lists cannot be updated from a callback as they will be invalidated. At the same time I have to update the lists as soon as possible or other operations called from the callback will use the deleted pointers.

Probably going to have to use a 'Delete' method that clears at the end of the event distribution

danishcake commented 14 years ago

Fixed by a series of commits from 4a65646048cab2ed1ad54654c141c511cd48d293 to 8af081032519265061649712a93cdfcc4fe547ab