[sword-devel] Mem leak in Sword

Joachim Ansorg sword-devel@crosswire.org
Sat, 14 Dec 2002 19:25:28 +0100


--------------Boundary-00=_GIG412S7T1IGGVR74LEW
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

Troy,

I was working on BibleTime's parallel display of more than one lexicon, w=
hich=20
displays only the keys which are in all selected modules.

Please have a look at the following test program, to go though WebstersDi=
ct it=20
uses almost 400MB of Ram. I think it's a mem leak.

Am I doing something wrong or is it really a bug in Sword?
I'm not sure if it only happens with WebstersDict.

Joachim
--=20
Joachim Ansorg
www.bibletime.de
www.ansorgs.de


--------------Boundary-00=_GIG412S7T1IGGVR74LEW
Content-Type: text/x-c++src;
  charset="iso-8859-15";
  name="test-sword.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="test-sword.cpp"

#include <swmgr.h>
#include <swmodule.h>

#include <iostream.h>

using namespace std;
using namespace sword;

int main (int argc, char* argv[]) {
	SWMgr mgr;
	SWModule* mod = mgr.Modules["WebstersDict"];	

	(*mod) = TOP; //first entry

	do {
		cout << mod->KeyText() << endl;
		(*mod)++;
	} while ( !mod->Error() );

	(*mod) = TOP; //back to first entry

};
--------------Boundary-00=_GIG412S7T1IGGVR74LEW--