Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties clear on GM restart #98

Open
Y-Less opened this issue Jul 15, 2018 · 2 comments
Open

properties clear on GM restart #98

Y-Less opened this issue Jul 15, 2018 · 2 comments

Comments

@Y-Less
Copy link
Member

Y-Less commented Jul 15, 2018

They weren't designed for systems that are long-running.

@Daniel-Cortez
Copy link
Contributor

I think a proper explanation is that properties in Pawn weren't designed for running more than one script at a time.

What happens is that when a script (and by that I mean literally any script, not only a GM as stated in the title) gets unloaded, amx_CoreCleanup() removes all properties, even those that were created by the other scripts.

https://github.com/pawn-lang/compiler/blob/master/source/amx/amxcore.c#L509-L512
In Pawn 3.0 there also was a comment in that part of code

  #if !defined AMX_NOPROPLIST
    //??? delete only the properties owned by the AMX
    while (proproot.next!=NULL)
      list_delete(&proproot,proproot.next);
  #endif

which means the original Pawn creator probably intended to delete only the properties created by the currently unloaded script, but judging by removal of this comment in 3.1/3.2 the idea was scrapped for some reason.

@Y-Less
Copy link
Member Author

Y-Less commented Jul 16, 2018

Yeah, I forgot that filterscripts could also be (un)loaded at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants