2006-01-09 Brad Taylor <brad@getcoded.net>

* gdk/Pixbuf.custom: Properly dispose of PixbufLoaders when we're done
	  with them.


svn path=/trunk/gtk-sharp/; revision=70728
This commit is contained in:
Brad Taylor 2007-01-09 17:00:52 +00:00
parent 418d60d8df
commit 8ac2a30048
2 changed files with 35 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2006-01-09 Brad Taylor <brad@getcoded.net>
* gdk/Pixbuf.custom: Properly dispose of PixbufLoaders when we're done
with them.
2006-12-28 Brad Taylor <brad@getcoded.net>
* sample/GtkDemo/Makefile.am:

View File

@ -101,24 +101,47 @@
gdk_pixbuf_render_to_drawable_alpha(Handle, drawable.Handle, src_x, src_y, dest_x, dest_y, width, height, (int) alpha_mode, alpha_threshold, (int) dither, x_dither, y_dither);
}
public Pixbuf (System.IO.Stream stream) : base (new PixbufLoader (stream).PixbufHandle) {}
public Pixbuf (System.IO.Stream stream) : base (IntPtr.Zero)
{
using (PixbufLoader pl = new PixbufLoader (stream)) {
Raw = pl.PixbufHandle;
}
}
public Pixbuf (System.IO.Stream stream, int width, int height) : base(new PixbufLoader (stream, width, height).PixbufHandle) {}
public Pixbuf (System.IO.Stream stream, int width, int height) : base (IntPtr.Zero)
{
using (PixbufLoader pl = new PixbufLoader (stream, width, height)) {
Raw = pl.PixbufHandle;
}
}
public Pixbuf (System.Reflection.Assembly assembly, string resource) : base (IntPtr.Zero)
{
Raw = new PixbufLoader (assembly == null ? System.Reflection.Assembly.GetCallingAssembly () : assembly, resource).PixbufHandle;
using (PixbufLoader pl = new PixbufLoader (assembly == null ? System.Reflection.Assembly.GetCallingAssembly () : assembly, resource)) {
Raw = pl.PixbufHandle;
}
}
public Pixbuf (System.Reflection.Assembly assembly, string resource, int width, int height) : base (IntPtr.Zero)
{
Raw = new PixbufLoader (assembly == null ? System.Reflection.Assembly.GetCallingAssembly () : assembly, resource, width, height).PixbufHandle;
using (PixbufLoader pl = new PixbufLoader (assembly == null ? System.Reflection.Assembly.GetCallingAssembly () : assembly, resource, width, height)) {
Raw = pl.PixbufHandle;
}
}
public Pixbuf (byte[] buffer) : base(new PixbufLoader (buffer).PixbufHandle) {}
public Pixbuf (byte[] buffer) : base (IntPtr.Zero)
{
using (PixbufLoader pl = new PixbufLoader (buffer)) {
Raw = pl.PixbufHandle;
}
}
public Pixbuf (byte[] buffer, int width, int height) : base(new PixbufLoader (buffer, width, height).PixbufHandle) {}
public Pixbuf (byte[] buffer, int width, int height) : base (IntPtr.Zero)
{
using (PixbufLoader pl = new PixbufLoader (buffer, width, height)) {
Raw = pl.PixbufHandle;
}
}
static public Pixbuf LoadFromResource (string resource)
{