The following are the initialization and finalization steps of 3ds Max that concern a plug-in's DLL.
LibInitialize()
.LibInitialize()
.NOTIFY_SYSTEM_STARTUP
is broadcast to all plug-ins.NOTIFY_SYSTEM_SHUTDOWN
is broadcast to all plug-ins.
NOTIFY_SYSTEM_SHUTDOWN2
is broadcast to all plug-ins.
The global utility plug-in manager shuts down all global utility plug-in. This involves calling the global utility plug-in DeleteThis()
methods.
MAXScript is uninitialized, according to the following steps:
NOTIFY_MXS_SHUTDOWN
.The macro-recorder is turned off.
A notification is broadcast NOTIFY_MXS_SHUTDOWN
.
The COM bridge is uninitialized.
The MAXScript interrupt checker thread is stopped. This is the thread that checks if the escape key is pressed during MAXScript execution.
The MAXScript plug-ins (*.dlx files) are freed
Each plug-in is shutdown through a call to LibShutDown()
. This is where a plug-in should free any remaining allocated memory, and perform the final uninitialization steps.