Skip to content

Commit

Permalink
Dont assume a function that throws an GError has parameters.
Browse files Browse the repository at this point in the history
See #45
  • Loading branch information
MikeWey committed Oct 27, 2024
1 parent 6f0a609 commit 441cf5f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source/gtd/GirFunction.d
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,11 @@ final class GirFunction
}

if ( throws )
ext ~= ", GError** err";
{
if ( params.length > 0 || instanceParam !is null )
ext ~= ", ";
ext ~= "GError** err";
}

return ext;
}
Expand Down Expand Up @@ -828,7 +832,9 @@ final class GirFunction
if ( throws )
{
buff ~= "GError* err = null;";
gtkCall ~= ", &err";
if ( params.length > 0 || instanceParam !is null )
gtkCall ~= ", ";
gtkCall ~= "&err";
}

enum throwGException = [
Expand Down

0 comments on commit 441cf5f

Please sign in to comment.