Fix impl Drop for Store for new StoreId interface
This commit is contained in:
parent
d5723791a6
commit
151877d95d
1 changed files with 13 additions and 5 deletions
|
@ -838,11 +838,19 @@ impl Drop for Store {
|
|||
* TODO: Unlock them
|
||||
*/
|
||||
fn drop(&mut self) {
|
||||
let store_id = StoreId::new(Some(self.location.clone()), PathBuf::from("."));
|
||||
match StoreId::new(Some(self.location.clone()), PathBuf::from(".")) {
|
||||
Err(e) => {
|
||||
trace_error(&e);
|
||||
warn!("Cannot construct StoreId for Store to execute hooks!");
|
||||
warn!("Will close Store without executing hooks!");
|
||||
},
|
||||
Ok(store_id) => {
|
||||
if let Err(e) = self.execute_hooks_for_id(self.store_unload_aspects.clone(), &store_id) {
|
||||
debug!("Store-load hooks execution failed. Cannot create store object.");
|
||||
warn!("Store Unload Hook error: {:?}", e);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
debug!("Dropping store");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue