summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/keyboard.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-08-05 23:48:05 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-02-22 15:31:24 -0500
commitf028a6bffb5626af40bd65a1a2293d2a13673c31 (patch)
tree4ed0f2b0215784a5470cb2188820dceac66440ea /libs/gtkmm2ext/keyboard.cc
parent40cef0a09c66c82efad9a44740e3c18699545bb0 (diff)
fix memory lifetime management issue
Diffstat (limited to 'libs/gtkmm2ext/keyboard.cc')
-rw-r--r--libs/gtkmm2ext/keyboard.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/libs/gtkmm2ext/keyboard.cc b/libs/gtkmm2ext/keyboard.cc
index efd189ddc1..b1f5d5561a 100644
--- a/libs/gtkmm2ext/keyboard.cc
+++ b/libs/gtkmm2ext/keyboard.cc
@@ -709,8 +709,6 @@ Keyboard::store_keybindings (string const & path)
XMLNode* bnode;
int ret = 0;
- std::cerr << "Save bindings to " << path << endl;
-
for (map<string,Bindings*>::const_iterator c = Bindings::bindings_for_state.begin(); c != Bindings::bindings_for_state.end(); ++c) {
bnode = new XMLNode (X_("Bindings"));
bnode->add_property (X_("name"), c->first);
@@ -719,14 +717,12 @@ Keyboard::store_keybindings (string const & path)
}
XMLTree tree;
- tree.set_root (node);
+ tree.set_root (node); /* tree now owns root and will delete it */
if (!tree.write (path)) {
error << string_compose (_("Cannot save key bindings to %1"), path) << endmsg;
ret = -1;
}
-
- delete node;
return ret;
}