[Mono-bugs] [Bug 360808] [OSX] Graphics contexts that do not call Dispose are not immediately drawn to the screen

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 14 14:02:28 EST 2008


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

User gnorton at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=360808#c1


Geoff Norton <gnorton at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |gnorton at novell.com
            Summary|Can't draw polygon                              |[OSX] Graphics contexts that do not call Dispose
                   |                                                |are not immediately drawn to the screen




--- Comment #1 from Geoff Norton <gnorton at novell.com>  2008-02-14 12:02:28 MST ---
This bug is going to be difficult to fix (if at all possible).  The issue is
that this demo creates graphics contexts and expects the results to be
implicitly flushed to the screen in real time which we cannot do on the mac for
a number of reasons.  They dont Dispose their context, and rely on the GC to do
that for them which isn't guaranteed in any amount of time.  The following
patch:

=== PolygonCuttingEarInterface/frmCuttingEars.cs
==================================================================
--- PolygonCuttingEarInterface/frmCuttingEars.cs        (revision 90096)
+++ PolygonCuttingEarInterface/frmCuttingEars.cs        (local)
@@ -654,6 +654,7 @@
                                //fill triangles in different color
                                int nBrush = i % 3;
                                gfx.FillPolygon(m_aBrushes[nBrush], tempArray);
+                               gfx.Dispose ();
                                Invalidate();
                        }
                }
@@ -678,6 +679,7 @@
                                {
                                        Graphics
gfx=this.pnlDraw.CreateGraphics();
                                        gfx.DrawPolygon(m_PolygonPen,
m_aPolygon);
+                                       gfx.Dispose ();
                                }
                        }
                }
@@ -727,6 +729,7 @@
                        startPt=new Point(x,y-2);
                        endPt=new Point(x,y+2);
                        gfx.DrawLine(Pens.Red,startPt, endPt);
+                       gfx.Dispose ();
                }


Fixes this problem by following good standards for MWF apps.  

I'll leave this bug open and rewrite its summary for information purposes for
now.


-- 
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