Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#425 Cygwin: Warning: can't allocate color black

open
Curt Mills
None
5
2012-09-15
2005-10-19
Curt Mills
No

With a refresh tag in a .geo file, one user is getting
the above listed warning. Looking at the code a bit we
appear to be XAllocColor() in several places but not
ever calling XFreeColors(). A bit of investigation
should reveal whether we should free them and when/how.

An interesting related link:
http://mail.gnome.org/archives/gtk-list/1998-April/msg00505.html

I suspect what I'm going to want to do is keep track of
which ones
we allocate and free the colors right after we either
draw the pixel
or after we draw each file. I'm just hoping it won't
be too slow
once we add that.

Here's XV's code for color allocation and free'ing,
which may be useful to us:
http://www.utdallas.edu/eecs/scad/scad/ftp/xv-3.00a/xvcolor.c

Discussion

  • Curt Mills
    Curt Mills
    2006-06-12

    Logged In: YES
    user_id=448632

    Another user had the "can't allocate color black" problem,
    both when running directly under Cygwin, and when running on
    a Linux box elsewhere, displaying on the Windows box (using
    a commercial X-server (XWin32 from StarNet Communications).
    By forcing the X-server to 24-bit, the problem appears to
    have disappeared.