diff --git a/.gitignore b/.gitignore index 6936990..d889fbf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target **/*.rs.bk Cargo.lock +.idea diff --git a/Cargo.toml b/Cargo.toml index dfe8cd3..daa18cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,4 @@ license = "Unlicense" description = "Safe(er) rust wrapper for dukbind." [dependencies] -dukbind = "0.0.4" \ No newline at end of file +dukbind = { path = "../dukbind" } diff --git a/src/lib.rs b/src/lib.rs index 1fe6575..630b82f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -370,10 +370,9 @@ impl DukContext { } } /// Destroy the duktape context's heap. Should not be used after calling this. - pub fn destroy(&mut self) { + pub fn destroy(self) { unsafe { duk_destroy_heap(self.ctx.expect("Invalid context pointer.")); - self.ctx = None; } } /// Decode a JSON string into the context, returning a DukObject.