diff --git a/src/core/Query/ListSelection.cpp b/src/core/Query/ListSelection.cpp index c98c03682..8f8a47665 100644 --- a/src/core/Query/ListSelection.cpp +++ b/src/core/Query/ListSelection.cpp @@ -540,6 +540,11 @@ void Query::ListSelection::QueryForMetadata(const char *metakey,const char *sql, tempMetadataValues.reserve(10); int row(0); + { + boost::mutex::scoped_lock lock(oLibrary->oResultMutex); + this->metadataResults[metakey]; + } + while(metaValueStmt.Step()==db::ReturnCode::Row){ tempMetadataValues.push_back( MetadataValuePtr( diff --git a/src/cube/MetadataFilterModel.cpp b/src/cube/MetadataFilterModel.cpp index 1015e1950..368b8208c 100644 --- a/src/cube/MetadataFilterModel.cpp +++ b/src/cube/MetadataFilterModel.cpp @@ -67,7 +67,7 @@ uistring MetadataFilterModel::CellValueToString(int rowIndex, ListView::Colum return (format(_T("All (%1% %2%)")) % this->metadata.size() % this->controller->metadataKey).str(); } - if(rowIndexmetadata.size()){ + if(rowIndex<=this->metadata.size()){ return win32cpp::Escape(this->metadata[rowIndex-1]->value); }else{ return uistring();