It was though to find code that actually replicates this issue, because at first it seemed to happen quite randomly. There might be more cases then this one.
It seems to happen when passing/storing playerinfo objects to multiple functions; I'm guessing they go out of scope when the first function finishes execution:
To reproduce
Code: Select all
import command_c
def h(playerinfo, command):
test(playerinfo)
test(playerinfo)
def test(playerinfo):
e = playerinfo.get_edict()
e.get_index()
print(e)
def load():
command_c.register_client_command_filter(h)
def unload():
command_c.unregister_client_command_filter(h)
Which will result in:
Code: Select all
<entity_c.CEdict object at 0x12345678>
(Traceback here)
RuntimeError: access violation - no RTTI data