Changeset 13789


Ignore:
Timestamp:
2007-01-25T11:55:04+13:00 (17 years ago)
Author:
mdewsnip
Message:

Fixed a problem with my previous change causing the local library to often crash when displaying a document. This was due to the document text being in memory that was deleted when the database was unloaded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/mgsearch.cpp

    r13780 r13789  
    208208int doctextcallback(char *Doc, int ULen,  int /*Freq*/,
    209209            float /*Weight*/,  void * /*info*/) {
    210   tempdoc = Doc;
     210  if (Doc != NULL) {
     211    // Make a copy of this string so we can unload the database without losing it
     212    tempdoc = new char[ULen + 1];
     213    strcpy(tempdoc, Doc);
     214  }
    211215  templen = ULen;
    212216 
     
    521525  inconvert.convert (output, status);
    522526
     527  delete[] mgdoc;
    523528  return true;
    524529}
Note: See TracChangeset for help on using the changeset viewer.