gdk_draw_region



	I'm trying to implement a function gdk_draw_region. I'd like to use
XFillRectangles (at least for the x11 implemntation) to minimize the
number of calls to X, but I have a question about when I can free
memory used in arguments passed to the function call. The relevant
part of the code is

static void
gdk_x11_draw_region (GdkDrawable *drawable,
                     GdkGC       *gc,
                     GdkRegion   *region)
{
  XRectangle *rectangles;

...
other stuff here
...

  XFillRectangles(impl->xdisplay, impl->xid, GDK_GC_GET_XGC(gc),
    rectangles, region->numRects);

  /* Do I need to wait for some signal from X here? */

  g_free(rectangles);
}

What happens to the contents of `rectangles'? Is it coplied into some
TCP packet, so I can free it immediately? Do I need to wait until
X draws the rectangles to free the memory? If so, how do I do that
(some sort of timeout/callback)? The treatment of `tmp_points'
in gdk_x11_draw_points seems to indicate I can free it immediately,
but I'd like to hear something from someone who is more familiar
with X than I am.
						Ron Steinke




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]