mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
palm_dictionary_make makes copy of name if needed. Helps plug memory leak.
This commit is contained in:
parent
2bb3c946d9
commit
6f7db1a202
2 changed files with 5 additions and 3 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "dictnryp.h"
|
||||
#include "dawg.h"
|
||||
#include "strutils.h"
|
||||
#include "palmdict.h"
|
||||
#include "dictlist.h"
|
||||
#include "dictui.h"
|
||||
|
@ -67,7 +68,7 @@ static array_edge* palm_dict_edge_for_index_multi( const DictionaryCtxt* dict,
|
|||
|
||||
DictionaryCtxt*
|
||||
palm_dictionary_make( MPFORMAL PalmAppGlobals* globals,
|
||||
XP_UCHAR* dictName, PalmDictList* dl )
|
||||
const XP_UCHAR* dictName, PalmDictList* dl )
|
||||
{
|
||||
Boolean found;
|
||||
UInt16 cardNo;
|
||||
|
@ -116,7 +117,7 @@ palm_dictionary_make( MPFORMAL PalmAppGlobals* globals,
|
|||
if ( !!dictName ) {
|
||||
XP_ASSERT( XP_STRLEN((const char*)dictName) > 0 );
|
||||
|
||||
ctxt->super.name = dictName;
|
||||
ctxt->super.name = copyString( mpool, dictName );
|
||||
ctxt->super.destructor = palm_dictionary_destroy;
|
||||
|
||||
found = getDictWithName( dl, dictName, &dle );
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
#include "dictui.h"
|
||||
|
||||
DictionaryCtxt* palm_dictionary_make( MPFORMAL PalmAppGlobals* globals,
|
||||
XP_UCHAR* dictName, PalmDictList* dl );
|
||||
const XP_UCHAR* dictName, /* copied */
|
||||
PalmDictList* dl );
|
||||
|
||||
#ifdef NODE_CAN_4
|
||||
void offerConvertOldDicts( PalmAppGlobals* globals );
|
||||
|
|
Loading…
Add table
Reference in a new issue