From 6a2e05edb8ac8c1e1cdbcfdcc9d42dcf2a2584c9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 1 Aug 2004 07:50:28 +0000 Subject: More tweaks svn-id: r14413 --- saga/actionmap.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/saga/actionmap.cpp b/saga/actionmap.cpp index 3410db91cd..055a5100b5 100644 --- a/saga/actionmap.cpp +++ b/saga/actionmap.cpp @@ -42,6 +42,11 @@ int ActionMap::reg(void) { ActionMap::ActionMap(void) { debug(0, "ACTIONMAP Module: Initializing..."); + + _exits_loaded = 0; + _exits_tbl = NULL; + _n_exits = 0; + _initialized = true; } @@ -120,16 +125,17 @@ int ActionMap::freeMap(void) { return R_SUCCESS; } - for (i = 0; i < _n_exits; i++) { - exmap_entry = &_exits_tbl[i]; + if (_exits_tbl) { + for (i = 0; i < _n_exits; i++) { + exmap_entry = &_exits_tbl[i]; - if (_exits_tbl[i]) - if (exmap_entry->pt_tbl) - free(exmap_entry->pt_tbl); - } + if (exmap_entry != NULL) + if (exmap_entry->pt_tbl) + free(exmap_entry->pt_tbl); + } - if (_exits_tbl) free(_exits_tbl); + } _exits_loaded = 0; _exits_tbl = NULL; -- cgit v1.2.3