Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5fcfb4073aa9b6e255f139d7d1bd1279baf4a6ba
Ticket: 468098ffffffffffffffffffffffffffffffffff
Tk_GetBitmapFromData broken
User & Date: nobody on 2001-10-04 22:32:18
Changes

  1. assignee changed to: "mdejong"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The now obsolete function Tk_GetBitmapFromData, if
    used, will corrupt the bitmap hashtable causing much
    grief later on...  This problem appears to be present
    in 8.4 as well.
    
    To put your mind at ease, after fixing this bug in Tk,
    I then went into my code and removed 
    Tk_GetBitmapFromData, replacing it with
    Tk_DefineBitmap.  If you don't fix the bug, then remove
    the function altogether.
    
    Thanks,
    -Brian
    
    
    The following fixes the problem:
    
    $ cvs diff -p tkBitmap.c
    Index: tkBitmap.c
    ===================================================================
    RCS file: /cvsroot/tktoolkit/tk/generic/tkBitmap.c,v
    retrieving revision 1.7.12.1
    diff -p -r1.7.12.1 tkBitmap.c
    *** tkBitmap.c  2001/04/04 07:57:16     1.7.12.1
    --- tkBitmap.c  2001/10/04 22:15:41
    *************** Tk_GetBitmapFromData(interp, tkwin,
    sour
    *** 818,825 ****
          char string[16 + TCL_INTEGER_SPACE];
          char *name;
          TkDisplay *dispPtr = ((TkWindow *)
    tkwin)->dispPtr;
      
    !     BitmapInit(dispPtr);
      
          nameKey.source = source;
          nameKey.width = width;
    --- 818,829 ----
          char string[16 + TCL_INTEGER_SPACE];
          char *name;
          TkDisplay *dispPtr = ((TkWindow *)
    tkwin)->dispPtr;
    +     ThreadSpecificData *tsdPtr = (ThreadSpecificData
    *) 
    +             Tcl_GetThreadData(&dataKey,
    sizeof(ThreadSpecificData));
      
    !     if (!tsdPtr->initialized) {
    !       BitmapInit(dispPtr);
    !     }
      
          nameKey.source = source;
          nameKey.width = width;
    
    
  4. foundin changed to: "obsolete: 8.3.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "52. Portability Support"
  10. title changed to: "Tk_GetBitmapFromData broken"
  11. type changed to: "Bug"