Skip to content

Commit

Permalink
latest libhoedown; don't free when unit == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
blaenk committed Apr 18, 2015
1 parent bfb5629 commit 48d64ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "hoedown"
version = "1.1.9"
version = "1.1.10"
authors = ["Jorge Israel Peña <[email protected]>"]
description = "bindings for the Hoedown markdown processor"
repository = "https://github.com/blaenk/hoedown"
Expand Down
2 changes: 1 addition & 1 deletion libhoedown
8 changes: 6 additions & 2 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ impl Buffer {

impl Drop for Buffer {
fn drop(&mut self) {
if self.is_owned {
unsafe { hoedown_buffer_free(*self.buffer); }
assert!(!self.buffer.is_null());

unsafe {
if self.is_owned && self.buffer.get().unit != 0 {
hoedown_buffer_free(*self.buffer);
}
}
}
}
Expand Down

0 comments on commit 48d64ea

Please sign in to comment.