mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-03-01 03:56:59 +00:00
* gdk/PixbufLoader.custom: Fix the new constructors to make sure
they call Close() in the event of an exception, to prevent a g_warning. svn path=/trunk/gtk-sharp/; revision=42577
This commit is contained in:
parent
23ec73d6f9
commit
249a13fc82
|
@ -1,3 +1,9 @@
|
||||||
|
2005-04-05 Dan Winship <danw@novell.com>
|
||||||
|
|
||||||
|
* gdk/PixbufLoader.custom: Fix the new constructors to make sure
|
||||||
|
they call Close() in the event of an exception, to prevent a
|
||||||
|
g_warning.
|
||||||
|
|
||||||
2005-04-05 Mike Kestner <mkestner@novell.com>
|
2005-04-05 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* gtk/DestroyHelper.cs : implement an internal DestroyNotify handler
|
* gtk/DestroyHelper.cs : implement an internal DestroyNotify handler
|
||||||
|
|
|
@ -48,16 +48,20 @@
|
||||||
|
|
||||||
while ((n = input.Read (buffer, 0, 8192)) != 0)
|
while ((n = input.Read (buffer, 0, 8192)) != 0)
|
||||||
Write (buffer, (uint) n);
|
Write (buffer, (uint) n);
|
||||||
Close ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PixbufLoader (System.IO.Stream stream) : this ()
|
public PixbufLoader (System.IO.Stream stream) : this ()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
LoadFromStream (stream);
|
LoadFromStream (stream);
|
||||||
|
} finally {
|
||||||
|
Close ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public PixbufLoader (System.Reflection.Assembly assembly, string resource) : this ()
|
public PixbufLoader (System.Reflection.Assembly assembly, string resource) : this ()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
if (assembly == null)
|
if (assembly == null)
|
||||||
assembly = System.Reflection.Assembly.GetCallingAssembly ();
|
assembly = System.Reflection.Assembly.GetCallingAssembly ();
|
||||||
|
|
||||||
|
@ -69,12 +73,12 @@
|
||||||
throw new ArgumentException ("'" + resource + "' is not a valid resource name of assembly '" + assembly + "'.");
|
throw new ArgumentException ("'" + resource + "' is not a valid resource name of assembly '" + assembly + "'.");
|
||||||
|
|
||||||
LoadFromStream (s);
|
LoadFromStream (s);
|
||||||
|
} finally {
|
||||||
|
Close ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public PixbufLoader LoadFromResource (string resource)
|
static public PixbufLoader LoadFromResource (string resource)
|
||||||
{
|
{
|
||||||
if (resource == null)
|
|
||||||
throw new ArgumentNullException ("resource");
|
|
||||||
|
|
||||||
return new PixbufLoader (System.Reflection.Assembly.GetCallingAssembly (), resource);
|
return new PixbufLoader (System.Reflection.Assembly.GetCallingAssembly (), resource);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue