- Timestamp:
- 2011-10-13T21:20:36+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/colservr/collectset.cpp
r22067 r24757 507 507 ++here; 508 508 } 509 // since all collection server objects are deleted (which deleted their source objects 510 // which in turn deleted their search objects), we now NULL the local reference to the 511 // search objects. See the extensive comment for this in remove_collection(text_t). 512 #ifdef ENABLE_MG 513 if (mgsearch != NULL) { 514 mgsearch = NULL; 515 } 516 #endif 517 #ifdef ENABLE_MGPP 518 if (mgppsearch != NULL) { 519 mgppsearch = NULL; 520 } 521 #endif 522 #ifdef ENABLE_LUCENE 523 if (lucenesearch != NULL) { 524 lucenesearch = NULL; 525 } 526 #endif 527 509 528 cservers.clear(); 510 529 } … … 583 602 if ((*here).second.c != NULL && (*here).first == collection) { 584 603 delete (*here).second.c; 585 cservers.erase (here); 604 605 // The above code deletes the collection server object for this collection, which then 606 // deletes the <indexer>source object, which then deletes the <indexer>search object. 607 // Since we have a reference to the <index>search object here, we have to set it to NULL 608 // at this point, because we test it against null-ness elsewhere in this code. (Without 609 // setting it to NULL, we end up with server crashing issues.) 610 // Ideally, we'd like to know that we are NULLing the pointer to the exact same object 611 // as was freed above, but we can't know that without complicated object access to make 612 // the necessary pointer comparison. Fortunately, this class maintains only one type of 613 // <index>search object (of a/any kind) at any time, so we can NULL this confidently now. 614 #ifdef ENABLE_MG 615 if (mgsearch != NULL) { 616 mgsearch = NULL; 617 } 618 #endif 619 #ifdef ENABLE_MGPP 620 if (mgppsearch != NULL) { 621 mgppsearch = NULL; 622 } 623 #endif 624 #ifdef ENABLE_LUCENE 625 if (lucenesearch != NULL) { 626 lucenesearch = NULL; 627 } 628 #endif 629 630 // continue cleaning up the collection server 631 cservers.erase (here); 632 586 633 return; 587 } 634 } // end if 588 635 ++here; 589 636 } … … 600 647 601 648 outconvertclass text_t2ascii; 602 logout << text_t2ascii << "collectset::remove_collection: failed to removecollectserver for "649 logout << text_t2ascii << "collectset::remove_collection: Removed collectserver for " 603 650 << collection << "\n"; 604 651 }
Note:
See TracChangeset
for help on using the changeset viewer.