[cairo] win32 code not thread safe

Jan Slupski jslupski at juljas.net
Thu Apr 5 05:14:08 PDT 2007


Ah, one more issue to bring back.


Win32 code uses _get_global_font_dc() function that uses shared 
variable for DC:

   static HDC
   _get_global_font_dc (void)
   {
       static HDC hdc;   //<<<<<<<<<<-----------------

This needs to be solved somehow.


In origial report I have proposed workaround, 
that made Cairo at least not to fail.

http://lists.freedesktop.org/archives/cairo/2007-February/009619.html

The code is not perfect since I create one separate DC instance per
thread, but I never free them. So app creating and _destroying_ threads
will have DC leakage. 
Some win32 hacker should find a better way.


Thanks,
Jan

    _  _  _  _  _____________________________________________
    | |_| |\ |  S L U P S K I             jslupski at juljas.net
  |_| | | | \|                             http://juljas.net/


More information about the cairo mailing list