Skip to content

Commit

Permalink
initialize Jsonnet::vm_ field to nullptr
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johnbartholomew committed Mar 10, 2024
1 parent d2f5e7c commit 55eafec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/libjsonnet++.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
#include "libjsonnet++.h"

namespace jsonnet {
Jsonnet::Jsonnet() {}
Jsonnet::Jsonnet(): vm_(nullptr) {}

Jsonnet::~Jsonnet()
{
Expand Down

0 comments on commit 55eafec

Please sign in to comment.