overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
127 stars 47 forks source link

Signal script proxies that were are sometimes not destroyed together with script engine: #1034

Open ksuprynowicz opened 1 week ago

ksuprynowicz commented 1 week ago
__pthread_kill_implementation 0x00007ffff04a816c
ScriptSignalV8Proxy::~ScriptSignalV8Proxy ScriptObjectV8Proxy.cpp:1220
ScriptSignalV8Proxy::~ScriptSignalV8Proxy ScriptObjectV8Proxy.cpp:1225
Application::notify Application.cpp:4292
ksuprynowicz commented 1 week ago

Sometimes script signal proxies do not get deleted with script engine since there's some remaining reference to their smart pointer. Then later when they get deleted script engine is already gone and access-after-delete happens, sometimes causing crash. To fix this we should try adding a check in script engine destructor that would assure that all the proxies are deleted. This could be accomplished with weak smart pointers.