Make sure scalar functions and hooks outlive the connection

This commit is contained in:
gwenn
2018-08-15 20:04:01 +02:00
parent 4770060396
commit 8c6ce46c17
2 changed files with 24 additions and 17 deletions

View File

@@ -230,7 +230,7 @@ impl Connection {
x_func: F,
) -> Result<()>
where
F: FnMut(&Context) -> Result<T> + Send,
F: FnMut(&Context) -> Result<T> + Send + 'static,
T: ToSql,
{
self.db
@@ -281,7 +281,7 @@ impl InnerConnection {
x_func: F,
) -> Result<()>
where
F: FnMut(&Context) -> Result<T> + Send,
F: FnMut(&Context) -> Result<T> + Send + 'static,
T: ToSql,
{
unsafe extern "C" fn call_boxed_closure<F, T>(