Tk Source Code

Attachment Details
Login
Overview

Artifact ID: 2a6f011dcf0ae3fe204c69023fb423b10f44e0a2
Ticket: 918052ffffffffffffffffffffffffffffffffff
Date: 2004-09-25 04:24:46
User: dgp
Artifact Attached: 7733e7e20b8e13164f924ee94b3545236be178ed
Filename:leak.c
Description:
Content:
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
int
main(int argc, char **argv)
{
    Display *display;
    Font font;
    XColor fg, bg;
    int iter = 50;

    if (argc > 1) {
	iter = atoi(argv[1]);
    }
    display = XOpenDisplay(":0");
    font = XLoadFont(display, "cursor");
    fg.red = fg.green = fg.blue = 0;
    bg.red = bg.green = bg.blue = 65535;
    while (iter--) {
	Cursor cursor = XCreateGlyphCursor(display, font, font,
		XC_watch, XC_watch + 1, &fg, &bg);
	XFreeCursor(display, cursor);
    }
    XCloseDisplay(display);
}