Fixed memory leak due to ghost activities not being destructed.