From 95dda1050d1f364f6fc2695b13060ca82854bb14 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 14 Oct 2014 13:20:05 +0200 Subject: client API: qthelper: fix bugs Pretty dumb oversights. --- libmpv/qthelper.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmpv/qthelper.hpp b/libmpv/qthelper.hpp index 07bf194a1d..59f1bac8c8 100644 --- a/libmpv/qthelper.hpp +++ b/libmpv/qthelper.hpp @@ -133,6 +133,7 @@ private: mpv_node_list *list = create_list(dst, false, qlist.size()); if (!list) goto fail; + list->num = qlist.size(); for (int n = 0; n < qlist.size(); n++) set(&list->values[n], qlist[n]); } else if (src.canConvert()) { @@ -140,6 +141,7 @@ private: mpv_node_list *list = create_list(dst, true, qmap.size()); if (!list) goto fail; + list->num = qmap.size(); for (int n = 0; n < qmap.size(); n++) { list->keys[n] = dup_qstring(qmap.keys()[n]); if (!list->keys[n]) { @@ -166,7 +168,7 @@ private: if (list) { for (int n = 0; n < list->num; n++) { if (list->keys) - delete list->keys[n]; + delete[] list->keys[n]; if (list->values) free_node(&list->values[n]); } -- cgit v1.2.3