summaryrefslogtreecommitdiff
path: root/tools/m4/vfunc.m4
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjell.ahlstedt@bredband.net>2016-02-25 08:53:37 +0100
committerKjell Ahlstedt <kjell.ahlstedt@bredband.net>2016-02-25 08:53:37 +0100
commit81bf1ecdd7dd6d71f19c1b59b0a1a68fa65d9cd3 (patch)
tree0d2ad7c22da764d617e6506145c82093fd6bbc54 /tools/m4/vfunc.m4
parent140c0146a6ee0a1928a9a8fc0dae0c9864b24240 (diff)
downloadglibmm-81bf1ecdd7dd6d71f19c1b59b0a1a68fa65d9cd3.tar.gz
gmmproc: Fix errthrow in _WRAP_VFUNC
* tools/m4/vfunc.m4: Propagate a Glib::Error exception to GError** error. Don't throw an exception in the callback function, called from C code. Bug #762437
Diffstat (limited to 'tools/m4/vfunc.m4')
-rw-r--r--tools/m4/vfunc.m442
1 files changed, 25 insertions, 17 deletions
diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4
index fd2aeb82..7819d3e7 100644
--- a/tools/m4/vfunc.m4
+++ b/tools/m4/vfunc.m4
@@ -89,11 +89,9 @@ ifelse($10,keep_return,`dnl
')dnl end refreturn_ctype
')dnl end void
}
+ifelse($16,,,`dnl if (exception_handler)
catch(...)
{
-ifelse($16, `', `dnl
- Glib::exception_handlers_invoke`'();
-', `dnl
try
{
ifelse($9,refreturn_ctype,`dnl
@@ -102,12 +100,30 @@ ifelse($9,refreturn_ctype,`dnl
return _CONVERT($3, $4, `obj->$16`'()');
')dnl
}
- catch(...)
- {
- Glib::exception_handlers_invoke`'();
- }
+')dnl end exception_handler
+ifelse($12,errthrow,`dnl
+ catch(Glib::Error& errormm)
+ {
+ errormm.propagate(error);
+ifelse($4,void,`dnl
+ return;
+',`dnl
+ifelse(`$15', `',`dnl
+ using RType = $4;
+ return RType`'();
+',`dnl
+ return _CONVERT($3,$4,`$15');
+')dnl
')dnl
}
+')dnl end errthrow
+ catch(...)
+ {
+ Glib::exception_handlers_invoke`'();
+ }
+ifelse($16,,,`dnl if (exception_handler)
+ }
+')dnl
}
}
@@ -121,17 +137,9 @@ dnl g_assert(base != nullptr);
// Call the original underlying C function:
if(base && base->$2)
- {
- ifelse($4,void,,`$4 retval = ')(*base->$2)`'($6);
-ifelse($12,errthrow,`dnl
- if(*error)
- ::Glib::Error::throw_exception(*error);
-')dnl
-ifelse($4,void,,` return retval;
-')dnl
- }
-
+ ifelse($4,void,,`return ')(*base->$2)`'($6);
ifelse($4,void,,`dnl
+
ifelse(`$15', `',`dnl
typedef $4 RType;
return RType`'();