diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-05-23 10:12:04 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-05-23 10:12:04 +0200 |
commit | 6cdfb489aea9b4e8ea7f3287c76227a573b75161 (patch) | |
tree | 937ecbce053b95deb5c9738f8795c02b1c338974 /font.h | |
parent | 02921f8851e5e864beafcaf085fec1017a93bde2 (diff) | |
download | vdr-6cdfb489aea9b4e8ea7f3287c76227a573b75161.tar.gz vdr-6cdfb489aea9b4e8ea7f3287c76227a573b75161.tar.bz2 |
Added a note about cFont::GetFont() not being thread-safe
Diffstat (limited to 'font.h')
-rw-r--r-- | font.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: font.h 2.1 2009/05/03 11:00:19 kls Exp $ + * $Id: font.h 2.2 2009/05/23 10:10:40 kls Exp $ */ #ifndef __FONT_H @@ -55,9 +55,11 @@ public: static const cFont *GetFont(eDvbFont Font); ///< Gets the given Font, which was previously set by a call to SetFont(). ///< If no SetFont() call has been made, the font as defined in the setup is returned. - ///< The caller must not use the returned font outside the scope in which - ///< it was retrieved by the call to GetFont(), because a call to SetFont() - ///< may delete an existing font. + ///< GetFont() is not thread-safe, and shall only be called from the main + ///< thread! A font returned by GetFont() must only be used locally inside the + ///< function it was retrieved from, and no long term pointer to it shall be kept, + ///< because the cFont object may become invalid at any time after the + ///< function that called GetFont() has returned. static cFont *CreateFont(const char *Name, int CharHeight, int CharWidth = 0); ///< Creates a new font object with the given Name and makes its characters ///< CharHeight pixels high. If CharWidth is given, it overwrites the font's |