I saw several questions about static local variable and static member of a class. From one comment in this and probably the most clear one link
C++ Primer says:
Each local static variable is initialized before the first time execution passes through the object's definition. Local statics are not destroyed when a function ends; they are destroyed when program terminates.
But I found that the above description "when program terminates" is ambiguous. Does it mean the application exit? or if it is a plugin, does it mean the plugin is unloaded?
I have noticed that local static variable is not destroyed in my plugin is unloaded when it is compiled in release mode on Linux before. But when I changed it to a class member, it is destroyed properly when the plugin is unloaded. The class/local static variable is used in the plugin only.
Can anybody give some explanation?