summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-02-27 11:34:49 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-02-27 11:34:49 (GMT)
commit75400cec6d897b6e5c3ffc2f7745ece7395ca48a (patch)
tree7f11f3bfc0e37739657f7679783ef9d6c988e025
parenteac8c8f015800262fd125ca163d63161dbb4eeb5 (diff)
downloadtk-75400cec6d897b6e5c3ffc2f7745ece7395ca48a.zip
tk-75400cec6d897b6e5c3ffc2f7745ece7395ca48a.tar.gz
tk-75400cec6d897b6e5c3ffc2f7745ece7395ca48a.tar.bz2
Fix old thread-safety issue. [Bug 470322]
-rw-r--r--ChangeLog3
-rw-r--r--generic/tkBitmap.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d2af78..27faeb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2006-02-27 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * generic/tkBitmap.c (Tk_GetBitmapFromData): Improve thread-safety.
+ [Bug 470322]
+
* generic/tkImgBmap.c (ImgBmapConfigureInstance): Force creation of
new Pixmaps before deletion of old ones to prevent stupid caching
problems. [Bug 480862]
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index 612e92a..c4900bc 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBitmap.c,v 1.14 2005/11/17 10:57:35 dkf Exp $
+ * RCS: @(#) $Id: tkBitmap.c,v 1.15 2006/02/27 11:34:49 dkf Exp $
*/
#include "tkPort.h"
@@ -809,8 +809,12 @@ Tk_GetBitmapFromData(
char string[16 + TCL_INTEGER_SPACE];
char *name;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- BitmapInit(dispPtr);
+ if (!tsdPtr->initialized) {
+ BitmapInit(dispPtr);
+ }
nameKey.source = source;
nameKey.width = width;