Merge pull request #839 from gwenn/collation_destroy

Fix create_collation
This commit is contained in:
gwenn 2020-11-07 12:08:49 +01:00 committed by GitHub
commit 1c64a088a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,12 @@ impl InnerConnection {
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(