Prevent double calls of perl_script_unload

This commit is contained in:
aquanight 2020-07-05 15:31:07 -06:00
commit 6012ec9e56
5 changed files with 41 additions and 5 deletions

View file

@ -8,6 +8,8 @@ typedef struct {
/* Script can be loaded from a file, or from some data in memory */
char *path; /* FILE: full path for file */
char *data; /* DATA: data used for the script */
int unloaded; /* Indicates unloading has been done, so it should be destroyed once all signals exit */
int active_signals; /* active signal calls into this script - prevents full teardown when nonzero */
} PERL_SCRIPT_REC;
extern GSList *perl_scripts;
@ -26,6 +28,11 @@ PERL_SCRIPT_REC *perl_script_load_data(const char *data);
/* Unload perl script */
void perl_script_unload(PERL_SCRIPT_REC *script);
/* Mark a script as entered */
void perl_script_enter(PERL_SCRIPT_REC *script);
/* Mark a script as exited */
void perl_script_exit(PERL_SCRIPT_REC *script);
/* Find loaded script by name */
PERL_SCRIPT_REC *perl_script_find(const char *name);
/* Find loaded script by package */