[CF-Devel] GTK client crash (under Windows, at least)

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Mon Dec 27 15:37:01 CST 2004


Nicolas Weeger wrote:
>>
     
       note that face 0 is never a valid face to display.
     
     >
     
     
     >
     
     
     >
     
      Actually, in the gtk code, if CONFIG_CACHE is set (and i think it's the 
     
     >
     
      'cache images' configuration option), pixmaps[ 0 ] does get a valid 
     
     >
     
      image to display. But otherwise, it's apparently NULL.
     
     >
     
      So code doesn't seem to check that.
     
     
  But face 0 is never really meant to be displayed.

  Basically, since it is known that is never a face, it can be used to hold a 
pixmap to display while waiting for the real pixmap to come down the pipe.

  BAsically, what happens is something like:
S->C: display face 1234
C: doesn't have 1234, so updates 1234 to point at 0 to have something to 
display.  Request 1234 face from server.
S->C: sends face 1234
C: renders face 1234, putting it in the right spot, so that 1234 no longer 
points at 0.


  Use of face 0 here was just a convenience on the fact that faces started at 1, 
so zero is available, and is in all the arrays.  The last face in the array 
could just as easily been used, in which case this would have also crashed with 
caching - its really a side effect that caching sets up this face to use for its 
own purposes.

  Note even in caching, face 0 should never be sent by the server as something 
to display - rather, it still uses the real face number, it's just the client 
uses face 0 instead.

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list