This patch calls dispose() explicitly on a number of heavy C++ objects so that they can be eagerly finalized instead of waiting for GC.