destroy() gets called after init() after extension reload?
Posted: 12 Jan 2024, 22:46
Everytime I reload an extension the terminal traces my extension starting up and then immediately after traces the destroy() function being called.
The extension isnt actually being destroyed though, which makes me think the terminal/log is not accurate as it should print the destroy trace first and only afterwards the init traces...
Heres my code as an example:
And the terminal traces :
It doesnt really cause any problems, but this behaviour is unexpected I think? Any chance it can be fixed somehow?
Cheers!
The extension isnt actually being destroyed though, which makes me think the terminal/log is not accurate as it should print the destroy trace first and only afterwards the init traces...
Heres my code as an example:
Code: Select all
@Override
public void init() {
API = getApi();
trace("ZoneExtension -- started");
_signUp = new SignUp();
_signUp.Init();
addRequestHandler(SignUpAssistantComponent.COMMAND_PREFIX, _signUp.SUAC);
trace("SignUp Assistant -- started");
_login = new Login();
_login.Init(this);
trace("Login Assistant -- started");
addEventHandler(SFSEventType.USER_JOIN_ZONE, JoinZoneEventHandler.class);
addEventHandler(SFSEventType.USER_DISCONNECT, UserDisconnectHandler.class);
addEventHandler(SFSEventType.USER_LEAVE_ROOM, UserLeaveHandler.class);
addEventHandler(SFSEventType.USER_LOGOUT, UserLogoutHandler.class);
addRequestHandler("Characters", RequestCharactersHandler.class);
addRequestHandler("CreateCharacter", RequestCreateNewCharacterHandler.class);
addRequestHandler("SelectCharacter", RequestSelectCharacterHandler.class);
addRequestHandler("DeleteCharacter", RequestDeleteCharacterHandler.class);
addRequestHandler("JoinServer", RequestJoinServerHandler.class);
addRequestHandler("MigrateServer", RequestMigrateServerHandler.class);
}
@Override
public void destroy() {
super.destroy();
_login.LAC.destroy();
trace("ZoneExtension -- stopped");
}
And the terminal traces :
Code: Select all
22:32:27,114 INFO [Thread-3] managers.SFSExtensionManager - Reloading extension: { Ext: ZoneExtension, Type: JAVA, Lev: ZONE, { Zone: ASOZone0 }, {} }
22:32:27,160 INFO [Thread-3] Extensions - {ZoneExtension}: ZoneExtension -- started
22:32:27,163 INFO [Thread-3] Extensions - {ZoneExtension}: SignUp Assistant -- started
22:32:27,164 INFO [Thread-3] Extensions - {ZoneExtension}: Login Assistant -- started
22:32:27,169 INFO [Thread-3] Extensions - {ZoneExtension}: ZoneExtension -- stopped // weird print? shouldnt this be at the top?
It doesnt really cause any problems, but this behaviour is unexpected I think? Any chance it can be fixed somehow?
Cheers!