mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 11:31:37 +08:00
Fix create_collation
The xDestroy callback is not called if the sqlite3_create_collation_v2() function fails.
This commit is contained in:
parent
a376ae4895
commit
47ec0e1d8f
@ -96,7 +96,12 @@ impl InnerConnection {
|
|||||||
Some(free_boxed_value::<C>),
|
Some(free_boxed_value::<C>),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
self.decode_result(r)
|
let res = self.decode_result(r);
|
||||||
|
// The xDestroy callback is not called if the sqlite3_create_collation_v2() function fails.
|
||||||
|
if res.is_err() {
|
||||||
|
drop(unsafe { Box::from_raw(boxed_f) });
|
||||||
|
}
|
||||||
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
fn collation_needed(
|
fn collation_needed(
|
||||||
|
Loading…
Reference in New Issue
Block a user