Changeset 19051

Show
Ignore:
Timestamp:
10/12/06 08:34:19 (2 years ago)
Author:
axeld
Message:

We must not have the font manager locked when locking the desktop (no matter
if read or write); there are some methods that cause a locking of the font
manager (like ServerFont::SetFamilyAndStyle()).
This fixes bug #885.

Location:
haiku/trunk/src/servers/app
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/servers/app/ServerApp.cpp

    r18990 r19051  
    10431043                        //      3) string - style 
    10441044                        //      4) float - size 
    1045                          
     1045 
    10461046                        char type[B_OS_NAME_LENGTH]; 
    10471047                        font_family familyName; 
     
    10531053                                && link.ReadString(styleName, sizeof(styleName)) == B_OK 
    10541054                                && link.Read<float>(&size) == B_OK) { 
    1055                                 BAutolock locker(gFontManager); 
     1055                                gFontManager->Lock(); 
    10561056 
    10571057                                FontStyle* style = gFontManager->GetStyle(familyName, styleName); 
    10581058                                if (style != NULL) { 
    10591059                                        ServerFont font(*style, size); 
     1060                                        gFontManager->Unlock(); 
     1061                                                // We must not have locked the font manager when 
     1062                                                // locking the desktop (through LockedDesktopSettings 
     1063                                                // below) 
     1064 
    10601065                                        LockedDesktopSettings settings(fDesktop); 
    10611066 
     
    10661071                                        else if (!strcmp(type, "fixed")) 
    10671072                                                settings.SetDefaultFixedFont(font); 
    1068                                 } 
     1073                                } else 
     1074                                        gFontManager->Unlock(); 
    10691075                        } 
    10701076                        break; 
  • haiku/trunk/src/servers/app/ServerFont.cpp

    r17933 r19051  
    241241/*! 
    242242        \brief Sets the ServerFont instance to whatever font is specified 
     243        This method will lock the font manager. 
     244 
    243245        \param familyID ID number of the family to set 
    244246        \param styleID ID number of the style to set