From b0e339cea50b9cce2f2c5556f02bc6f5691f6d2b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 18 Jun 2013 15:14:17 -0700 Subject: [PATCH] ObjectStore: only register non-null contexts Signed-off-by: Samuel Just --- src/os/ObjectStore.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 3bcc6e90f4c..7310d53b0ee 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -178,15 +178,19 @@ public: tolerate_collection_add_enoent = true; } void register_on_applied(Context *c) { + if (!c) return; on_applied.push_back(c); } void register_on_commit(Context *c) { + if (!c) return; on_commit.push_back(c); } void register_on_applied_sync(Context *c) { + if (!c) return; on_applied_sync.push_back(c); } void register_on_complete(Context *c) { + if (!c) return; RunOnDeleteRef _complete(new RunOnDelete(c)); register_on_applied(new ContainerContext(_complete)); register_on_commit(new ContainerContext(_complete)); -- 2.47.3