Changeset: 0ad1a0ec7921 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ad1a0ec7921
Modified Files:
monetdb5/mal/mal_client.c
monetdb5/mal/mal_module.h
Branch: default
Log Message:
Remove leaking modules
diffs (36 lines):
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -227,7 +227,12 @@ MCinitClientRecord(Client c, oid user, b
* be aware, a user can introduce several modules
* that should be freed to avoid memory leaks */
if (c->nspace) {
- freeModule(c->nspace);
+ Module m, nm;
+ for( m = c->nspace; m!= mal_scope; m= m->outer){
+ nm= m->outer;
+ freeModule(m);
+ m= nm;
+ }
c->nspace = 0;
}
diff --git a/monetdb5/mal/mal_module.h b/monetdb5/mal/mal_module.h
--- a/monetdb5/mal/mal_module.h
+++ b/monetdb5/mal/mal_module.h
@@ -24,6 +24,7 @@ typedef struct SCOPEDEF {
str help; /* short description of module
functionality*/
} *Module, ModuleRecord;
+mal_export Module mal_scope;
mal_export void setModuleJump(str nme, Module cur);
mal_export Module newModule(Module scope, str nme);
@@ -44,6 +45,7 @@ mal_export char **getHelp(Module m, str
mal_export char **getHelpMatch(char *pat);
mal_export void showHelp(Module m, str txt,stream *fs);
+
#define getSubScope(N) (*(N))
#endif /* _MAL_SCOPE_H_ */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list