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

Fix calling AtExit methods after loading a workspace #2578

Merged
merged 2 commits into from
Jun 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/oper.g
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,7 @@ end );
#F InstallAtExit( <func> ) . . . . . . . . . . function to call when exiting
##
BIND_GLOBAL( "InstallAtExit", function( func )
local f;
if not IS_FUNCTION(func) then
Error( "<func> must be a function" );
fi;
Expand All @@ -1624,6 +1625,13 @@ BIND_GLOBAL( "InstallAtExit", function( func )
Error( "<func> must accept zero arguments" );
fi;
fi;
# Return if function has already been installed
# Use this long form to support both List and AtomicList
for f in GAPInfo.AtExitFuncs do
if f = func then
return;
fi;
od;
ADD_LIST( GAPInfo.AtExitFuncs, func );
end );

Expand Down
1 change: 1 addition & 0 deletions lib/session.g
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ BindGlobal("POST_RESTORE", function()
fi;
od;
SESSION();
PROGRAM_CLEAN_UP();
end);

if IsHPCGAP then
Expand Down