internal SourceBitmap(Source from, string url, byte[] bitmapBytes) { try { bitmapData = bitmapBytes; ms = new MemoryStream(bitmapData); bitmap = new Bitmap(ms); s = Settings.Instance; parent = from; Url = url; } catch { Dispose(true); throw; } }
protected virtual void Dispose(bool disposing) { if (disposing) { if (bitmap != null) { var tb = bitmap; bitmap = null; tb.Dispose(); } if (ms != null) { var tms = ms; ms = null; tms.Dispose(); } bitmapData = null; parent = null; s = null; } }