Obligatory "I ruined everything!" thread
#20
C++ is the same.
Your code in thread A grabs a pointer. It gets pre-empted by thread B. Thread B deletes the entity. Now thread A has an invalid pointer and is gonna call its method. Bang!
The point of DoWithEntity() is that while it's executing (including the callback), the internal lock is held, guaranteeing that no other thread is manipulating (especially deleting) entities.
Reply
Thanks given by:


Messages In This Thread
RE: Obligatory "I ruined everything!" thread - by xoft - 07-12-2012, 03:43 AM



Users browsing this thread: 1 Guest(s)