aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/malloc.cpp')
-rw-r--r--src/malloc.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/malloc.cpp b/src/malloc.cpp
index 393437e3..9ac28546 100644
--- a/src/malloc.cpp
+++ b/src/malloc.cpp
@@ -48,6 +48,10 @@
#include "proj.h"
#include "proj_internal.h"
+#include "grids.hpp"
+#include "filemanager.hpp"
+
+using namespace NS_PROJ;
/**********************************************************************/
void *pj_malloc(size_t size) {
@@ -225,10 +229,8 @@ PJ *pj_default_destructor (PJ *P, int errlev) { /* Destructor */
pj_dealloc(P->def_spherification);
pj_dealloc(P->def_ellps);
- /* free grid lists */
- pj_dealloc( P->gridlist );
- pj_dealloc( P->vgridlist_geoid );
- pj_dealloc( P->catalog_name );
+ delete static_cast<ListOfHGrids*>(P->hgrids_legacy);
+ delete static_cast<ListOfVGrids*>(P->vgrids_legacy);
/* We used to call pj_dalloc( P->catalog ), but this will leak */
/* memory. The safe way to clear catalog and grid is to call */
@@ -261,4 +263,5 @@ void proj_cleanup() {
/*****************************************************************************/
pj_clear_initcache();
pj_deallocate_grids();
+ FileManager::clearMemoryCache();
}