[Mono-bugs] [Bug 485826] Constructing a Graphics object using FromHdc with a Memory DeviceContext causes crash. .NET difference

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 16 19:26:51 EDT 2009


https://bugzilla.novell.com/show_bug.cgi?id=485826

User tom_hindle at sil.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=485826#c1





--- Comment #1 from tom hindle <tom_hindle at sil.org>  2009-03-16 17:26:50 MST ---
Seems it not just an issue with Memory buffers:

The following program compiles and runs on .NET but crashes on mono


using System;
using System.Drawing;
using System.Windows.Forms;

public class MyForm : Form
{
    [STAThreadAttribute()]
    static void Main()
    {
        Application.Run(new MyForm());
    }



    protected override void OnPaint(PaintEventArgs e)
    {

        // Get handle to device context.
        IntPtr hdc = e.Graphics.GetHdc();
        Graphics newGraphics = Graphics.FromHdc(hdc);
        Graphics newGraphics2 = Graphics.FromHdc(newGraphics.GetHdc());        
        newGraphics2.Dispose();
        newGraphics.Dispose();
    }

}

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list