gtkd-developers / GtkD

GtkD is a D binding and OO wrapper of GTK+ originally created by Antonio Monteiro
http://gtkd.org
Other
322 stars 71 forks source link

gdk_pixbuf throwing inaccurate exceptions #118

Closed CromFr closed 9 years ago

CromFr commented 9 years ago

https://github.com/gtkd-developers/GtkD/blob/master/src/gdkpixbuf/Pixbuf.d#L344 Should be more like:

public this(string filename)
{
    GError* err = null;
    auto p = gdk_pixbuf_new_from_file(Str.toStringz(filename), &err);
    if(p is null)
    {
        if (err !is null)
        {
            throw new GException( new ErrorG(err) );
        }
        throw new ConstructionException("null returned by new_from_file");
    }
    this(cast(GdkPixbuf*) p, true);
}

The same issue happens in other parts of the same file, maybe also in other files.

MikeWey commented 9 years ago

There were indeed more places where this heapend.

CromFr commented 9 years ago

Thanks for fixing this issue so quickly :)