X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcwindowbase.C;h=d7440bde39000d7499153dada1e0dbbda26fcb4e;hb=09415d6aba2e181c49863393a047d0947c969d21;hp=24dc5872e0e3ee426b504bffd009a9c305ede949;hpb=6853a2c0b04cc5ff4e87a2022c914227f925cb7f;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 24dc5872..d7440bde 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -182,10 +182,12 @@ BC_WindowBase::~BC_WindowBase() for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; ) XFreeFont(display, this->*xfont[i]); -// past bug in X caused XRenderExtensionInfo to be damaged -// if this is done here. left to be done in XCloseDisplay by Xlib. -// works in more modern systems, and needed for leak testing. -#if defined(HAVE_XFT) && defined(VALGRIND) +#ifdef HAVE_XFT +// prevents a bug when Xft closes with unrefd fonts + FcPattern *defaults = FcPatternCreate(); + FcPatternAddInteger(defaults, "maxunreffonts", 0); + XftDefaultSet(display, defaults); + static void *BC_WindowBase::*xft_font[] = { &BC_WindowBase::smallfont_xft, &BC_WindowBase::mediumfont_xft, @@ -390,12 +392,8 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title #endif id = get_resources()->get_id(); - int need_lock = 0; if(parent_window) top_level = parent_window->top_level; - if( top_level ) { // need this to avoid deadlock with Xlib's locks - need_lock = 1; - lock_window("BC_WindowBase::create_window"); - } + if( top_level ) lock_window("BC_WindowBase::create_window"); get_resources()->create_window_lock->lock("BC_WindowBase::create_window"); #ifdef HAVE_LIBXXF86VM @@ -445,6 +443,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title if( shm_completion_event < 0 ) shm_completion_event = ShmCompletion + XShmGetEventBase(display); #endif + lock_window("BC_WindowBase::create_window 1"); screen = DefaultScreen(display); rootwin = RootWindow(display, screen); @@ -638,7 +637,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title if(!hidden) show_window(); } get_resources()->create_window_lock->unlock(); - if(need_lock) unlock_window(); + unlock_window(); return 0; }