Skip to content

Commit 55eafec

Browse files
initialize Jsonnet::vm_ field to nullptr
The Jsonnet class constructor doesn't set up the VM; this is deferred until the user calls init(). However it's important for the vm_ field to itself be initialised to a known value. The Jsonnet destructor will attempt to destroy the VM only if the vm_ field is not null.
1 parent d2f5e7c commit 55eafec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/libjsonnet++.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
#include "libjsonnet++.h"
1818

1919
namespace jsonnet {
20-
Jsonnet::Jsonnet() {}
20+
Jsonnet::Jsonnet(): vm_(nullptr) {}
2121

2222
Jsonnet::~Jsonnet()
2323
{

0 commit comments

Comments
 (0)