fix ref problem with gc's from the gc cache. fixes bug 32120

This commit is contained in:
pavlov%netscape.com 2000-03-31 09:55:47 +00:00
parent d670519029
commit 8ae4c3bced
2 changed files with 7 additions and 3 deletions

View File

@ -96,12 +96,12 @@ GdkGC *nsGCCache::GetGCFromDW(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMa
if (gc_cache[i].clipRegion &&
gdk_region_equal(clipRegion, gc_cache[i].clipRegion)) {
// printf("found GC in cache %i\n", ++numCalls);
return gc_cache [i].gc;
return gdk_gc_ref(gc_cache[i].gc);
}
} else {
if(!gc_cache[i].clipRegion)
// printf("found GC in cache (no region) %i\n", ++numCalls);
return gc_cache [i].gc;
return gdk_gc_ref(gc_cache[i].gc);
}
}
@ -139,7 +139,7 @@ GdkGC *nsGCCache::GetGCFromDW(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMa
gc_cache [this_slot].gc = gc;
return gc;
return gdk_gc_ref(gc);
}
}

View File

@ -485,6 +485,10 @@ void nsRenderingContextGTK::UpdateGC()
GdkGCValues values;
GdkGCValuesMask valuesMask;
if (mGC)
gdk_gc_unref(mGC);
memset(&values, 0, sizeof(GdkGCValues));
values.font = mCurrentFont;