add regression test for dealloc
(github issue #1, fixed by seNes@32cc861)