X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Futils.cpp;h=64e5cdcc91d87a3580d66a4dfe6c9d6fede353e8;hb=c277943ace48d2f22f7016ba9439ff7cb949a231;hp=07c0a1f6ff86f532634491c3eccb12687d47e75e;hpb=22abfbe8c78e339188096a5bf749a7c2d4f0a368;p=ginac.git diff --git a/ginac/utils.cpp b/ginac/utils.cpp index 07c0a1f6..64e5cdcc 100644 --- a/ginac/utils.cpp +++ b/ginac/utils.cpp @@ -4,7 +4,7 @@ * but not of any interest to the user of the library. */ /* - * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -388,12 +388,63 @@ library_init::library_init() library_init::~library_init() { if (--count==0) { - // In theory, we would have to clean up here. But since we were - // only initializing memory in the ctor and that memory is reclaimed - // anyways by the OS when the program exits, we skip this. + // It's really necessary to clean up, since the program + // lifetime might not be the same as libginac.{so,dll} one + // (e.g. consider // dlopen/dlsym/dlclose sequence). + delete _num120_p; + delete _num_120_p; + delete _num60_p; + delete _num_60_p; + delete _num48_p; + delete _num_48_p; + delete _num30_p; + delete _num_30_p; + delete _num25_p; + delete _num_25_p; + delete _num24_p; + delete _num_24_p; + delete _num20_p; + delete _num_20_p; + delete _num18_p; + delete _num_18_p; + delete _num15_p; + delete _num_15_p; + delete _num12_p; + delete _num_12_p; + delete _num11_p; + delete _num_11_p; + delete _num10_p; + delete _num_10_p; + delete _num9_p; + delete _num_9_p; + delete _num8_p; + delete _num_8_p; + delete _num7_p; + delete _num_7_p; + delete _num6_p; + delete _num_6_p; + delete _num5_p; + delete _num_5_p; + delete _num4_p; + delete _num_4_p; + delete _num3_p; + delete _num_3_p; + delete _num2_p; + delete _num_2_p; + delete _num1_p; + delete _num_1_p; + delete _num1_2_p; + delete _num_1_2_p; + delete _num1_3_p; + delete _num_1_3_p; + delete _num1_4_p; + delete _num_1_4_p; + delete _num0_p; } } +void library_init::init_unarchivers() { } + // comment skeleton for header files