summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-07-08 07:54:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-07-08 07:54:08 (GMT)
commit973b6e6d17b26ec027eb3b6df3b37d9da9d9f514 (patch)
tree16cd8e062060db885208ea156a7c74aa9751ee83 /win/tkWinWm.c
parent649ce6ba5bb32fc38e88fc8f4ac13359651d1d32 (diff)
downloadtk-973b6e6d17b26ec027eb3b6df3b37d9da9d9f514.zip
tk-973b6e6d17b26ec027eb3b6df3b37d9da9d9f514.tar.gz
tk-973b6e6d17b26ec027eb3b6df3b37d9da9d9f514.tar.bz2
Use size_t in stead of int for some internal refCount variables. On 32-bit systems, this doubles the range (as size_t is unsigned), on 64-bit system much more than that.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 4d46fd5..768ee69 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -148,7 +148,7 @@ typedef struct {
*/
typedef struct WinIconInstance {
- int refCount; /* Number of instances that share this data
+ size_t refCount; /* Number of instances that share this data
* structure. */
BlockOfIconImagesPtr iconBlock;
/* Pointer to icon resource data for image */
@@ -1421,9 +1421,7 @@ static void
DecrIconRefCount(
WinIconPtr titlebaricon)
{
- titlebaricon->refCount--;
-
- if (titlebaricon->refCount <= 0) {
+ if (titlebaricon->refCount-- <= 1) {
if (titlebaricon->iconBlock != NULL) {
FreeIconBlock(titlebaricon->iconBlock);
}