[sword-svn] r2497 - trunk/src/modules

scribe at crosswire.org scribe at crosswire.org
Mon Dec 28 11:03:22 MST 2009


Author: scribe
Date: 2009-12-28 11:03:22 -0700 (Mon, 28 Dec 2009)
New Revision: 2497

Modified:
   trunk/src/modules/swmodule.cpp
Log:
moved wcharBuffer to the heap


Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2009-12-27 22:32:36 UTC (rev 2496)
+++ trunk/src/modules/swmodule.cpp	2009-12-28 18:03:22 UTC (rev 2497)
@@ -992,12 +992,8 @@
 
 
 signed char SWModule::createSearchFramework(void (*percent)(char, void *), void *percentUserData) {
+
 #ifdef USELUCENE
-	SWKey *saveKey = 0;
-	SWKey *searchKey = 0;
-	SWKey textkey;
-	SWBuf c;
-	const int MAX_CONV_SIZE = 1024 * 1024;
 	SWBuf target = getConfigEntry("AbsoluteDataPath");
 	if (!target.endsWith("/") && !target.endsWith("\\")) {
 		target.append('/');
@@ -1006,7 +1002,14 @@
 	int status = FileMgr::createParent(target+"/dummy");
 	if (status) return -1;
 
+	SWKey *saveKey = 0;
+	SWKey *searchKey = 0;
+	SWKey textkey;
+	SWBuf c;
 
+	const int MAX_CONV_SIZE = 1024 * 1024;
+	wchar_t *wcharBuffer = new wchar_t[MAX_CONV_SIZE + 1];
+
 	// turn all filters to default values
 	StringList filterSettings;
 	for (OptionFilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
@@ -1081,8 +1084,6 @@
 	SWBuf proxLem;
 	SWBuf strong;
 
-	wchar_t wcharBuffer[MAX_CONV_SIZE + 1];
-
 	char err = Error();
 	while (!err) {
 		long mindex = key->Index();
@@ -1342,6 +1343,8 @@
 		(*filter)->setOptionValue(*origVal++);
 	}
 
+	delete [] wcharBuffer;
+
 	return 0;
 #else
 	return SWSearchable::createSearchFramework(percent, percentUserData);




More information about the sword-cvs mailing list