Changeset

8312:6fd36e73082b

util.pubsub: Clear data on node deletion
author Kim Alvefur <zash@zash.se>
date Mon, 09 Oct 2017 01:57:55 +0200
parents 8311:df8c82d285dc
children 8313:21466b778bf1
files util/pubsub.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/pubsub.lua	Mon Oct 09 01:45:20 2017 +0200
+++ b/util/pubsub.lua	Mon Oct 09 01:57:55 2017 +0200
@@ -244,6 +244,9 @@
 		return false, "item-not-found";
 	end
 	self.nodes[node] = nil;
+	if self.data[node] and self.data[node].clear then
+		self.data[node]:clear();
+	end
 	self.data[node] = nil;
 	self.events.fire_event("node-deleted", { node = node, actor = actor });
 	self.config.broadcaster("delete", node, node_obj.subscribers);