fix bug when exiting the object pool destructor called multiple times