729 newHandle = idxDbs_.size() - 1; |
729 newHandle = idxDbs_.size() - 1; |
730 qbacs_[qbac] = PathAndHndl(idp.c_str(), |
730 qbacs_[qbac] = PathAndHndl(idp.c_str(), |
731 newHandle); |
731 newHandle); |
732 storeReg(); |
732 storeReg(); |
733 |
733 |
734 std::vector<IIdxDbInfo>::iterator |
734 std::vector<IIdxDbInfo>::iterator i, end; |
735 i = multiIdxDbs_.begin(), |
735 if (!(multiIdxDbs_.empty())) { |
736 end = multiIdxDbs_.end(); |
736 i = multiIdxDbs_.begin(); |
737 for (; i!= end; ++i) |
737 end = multiIdxDbs_.end(); |
738 { |
738 for (; i!= end; ++i) |
739 if (i->ptr() != NULL) |
739 { |
740 { |
740 if (i->ptr() != NULL) |
741 MultiIdxDb |
741 { |
742 * m = dynamic_cast<MultiIdxDb*>(i->ptr()); |
742 MultiIdxDb |
743 m->suggestHndl(newHandle, |
743 * m = dynamic_cast<MultiIdxDb*>(i->ptr()); |
744 qualBaseAppClass); |
744 if ( m ) |
745 } |
745 m->suggestHndl(newHandle, |
746 } |
746 qualBaseAppClass); |
|
747 } |
|
748 } |
|
749 } |
747 } |
750 } |
748 } |
751 } |
749 |
752 |
750 |
753 |
751 void IdxDbMgr::undefineVolume(const char * qualBaseAppClass) |
754 void IdxDbMgr::undefineVolume(const char * qualBaseAppClass) |
784 // re-instantiated, because qbac/path information |
787 // re-instantiated, because qbac/path information |
785 // has been deleted |
788 // has been deleted |
786 |
789 |
787 storeReg(); |
790 storeReg(); |
788 |
791 |
789 vector<IIdxDbInfo>::iterator |
792 vector<IIdxDbInfo>::iterator i, end; |
790 i = multiIdxDbs_.begin(), |
793 if (!(multiIdxDbs_.empty())) { |
|
794 i = multiIdxDbs_.begin(); //coverty 121612 121611 |
791 end = multiIdxDbs_.end(); |
795 end = multiIdxDbs_.end(); |
792 for (; i != end; ++i) |
796 for (; i != end; ++i) |
793 { |
797 { |
794 if (i->ptr() != NULL) |
798 if (i->ptr() != NULL) |
795 { |
799 { |
796 MultiIdxDb |
800 MultiIdxDb |
797 * m = dynamic_cast<MultiIdxDb*>(i->ptr()); |
801 * m = dynamic_cast<MultiIdxDb*>(i->ptr()); |
|
802 if ( m ){ |
798 bool |
803 bool |
799 used = m->removeHndl(hndl); |
804 used = m->removeHndl(hndl); |
800 |
805 |
801 if (used) |
806 if (used) |
802 { |
807 { |
803 idxDbs_[hndl].decRefCount(); |
808 idxDbs_[hndl].decRefCount(); |
804 } |
809 } |
|
810 } |
805 } |
811 } |
806 } |
812 } |
|
813 } |
807 |
814 |
808 // At this point, all multiidx-es have lost their |
815 // At this point, all multiidx-es have lost their |
809 // reference to the index in question |
816 // reference to the index in question |
810 // |
817 // |
811 // At worst, there may be some search / index |
818 // At worst, there may be some search / index |