Menu

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

v1.0_(example)
closed
None
5
2023-07-08
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.

     
  • Tom Russo

    Tom Russo - 2023-07-08
    • status: open --> closed
    • Group: --> v1.0_(example)
     
  • Tom Russo

    Tom Russo - 2023-07-08

    The Xastir project no longer uses sourceforge for issue tracking and I am closing all open issues (all of which are very old).

    If this issue is still important, please open a new one on https://github.com/Xastir/Xastir.

     

Log in to post a comment.