[gtkada] Add_From_File with null for Error.
Pascal
p.p14 at orange.fr
Sat Feb 22 18:07:58 CET 2014
Hello,
About using:
function Add_From_File
(Builder : not null access Gtk_Builder_Record;
Filename : UTF8_String;
Error : access Glib.Error.GError) return Guint
As in C GTK programming, I put null for Error parameter thus I got:
Exception name: CONSTRAINT_ERROR
Message: gtk-builder.adb:149 access check failed
Here is a patch proposal:
--- ./gtk-builder.adb.0 2013-04-29 14:58:58.000000000 +0200
+++ ./gtk-builder.adb 2014-02-16 13:27:01.000000000 +0100
@@ -146,7 +146,9 @@
begin
Tmp_Return := Internal (Get_Object (Builder), Tmp_Filename, Acc_Error'Access);
Free (Tmp_Filename);
- Error.all := Acc_Error;
+ if Error /= null then
+ Error.all := Acc_Error;
+ end if;
return Tmp_Return;
end Add_From_File;
Maybe similar situations occur there:
./include/gnatcoll/gnatcoll-scripts-python.adb:1672: Error.all := False;
./include/gnatcoll/gnatcoll-scripts-python.adb:1688: Error.all := True;
./include/gnatcoll/gnatcoll-scripts-python.adb:1738: Error.all := True;
./include/gnatcoll/gnatcoll-scripts-python.adb:1784: Error.all := True;
./include/gnatcoll/gnatcoll-scripts-shell.adb:1953: Error.all := False;
./include/gnatcoll/gnatcoll-scripts-shell.adb:2013: Error.all := True;
./include/gnatcoll/gnatcoll-scripts-shell.adb:2029: Error.all := True;
./include/gtkada/gtk-builder.adb:149: Error.all := Acc_Error;
./include/gtkada/gtk-css_provider.adb:94: Error.all := Acc_Error;
./include/gtkada/gtk-css_provider.adb:119: Error.all := Acc_Error;
./include/gtkada/gtk-ui_manager.adb:130: Error.all := Acc_Error;
./include/gtkada/gtk-ui_manager.adb:155: Error.all := Acc_Error;
HTH, Pascal.
http://blady.pagesperso-orange.fr
More information about the gtkada
mailing list