From 1bd63ce35c23e16e19813ce5b1a0224ceb7a1539 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 15 Mar 2014 08:29:53 -0700 Subject: [PATCH] Fix crash after inserting lines via subs.insert --- src/auto4_lua_assfile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auto4_lua_assfile.cpp b/src/auto4_lua_assfile.cpp index ec8332587..e83f929aa 100644 --- a/src/auto4_lua_assfile.cpp +++ b/src/auto4_lua_assfile.cpp @@ -542,7 +542,8 @@ namespace Automation4 { } int n = lua_gettop(L); - std::vector new_entries(n - 1, nullptr); + std::vector new_entries; + new_entries.reserve(n - 1); for (int i = 2; i <= n; i++) { lua_pushvalue(L, i); auto e = LuaToAssEntry(L);