fix shared library finalize issue
Merge pull request #2 from rainers/structDestructors

fix shared library finalize issue