XPLM_MSG_PLANE_UNLOADED

#define XPLM_MSG_PLANE_UNLOADED 106

This message is sent to your plugin whenever a plane is unloaded. The parameter contains the index number of the plane being unloaded; 0 indicates the user’s plane. The parameter is of type int, passed as the value of the pointer. (That is: the parameter is an int, not a pointer to an int.)