Skip to content
Snippets Groups Projects
  • Jim's avatar
    103ef753
    Improve thread safety for scene items · 103ef753
    Jim authored
    Scene items previously were removed by calling obs_sceneitem_destroy,
    but this proved to be a potential race condition where two different
    threads could try to destroy the same scene item at the same time.
    
    Instead of doing that, reference counting is now used on scene items,
    and an explicit obs_sceneitem_remove function is used instead for item
    removal, which sets a 'removed' variable to ensure it can only be called
    exactly one time.
    103ef753
    History
    Improve thread safety for scene items
    Jim authored
    Scene items previously were removed by calling obs_sceneitem_destroy,
    but this proved to be a potential race condition where two different
    threads could try to destroy the same scene item at the same time.
    
    Instead of doing that, reference counting is now used on scene items,
    and an explicit obs_sceneitem_remove function is used instead for item
    removal, which sets a 'removed' variable to ensure it can only be called
    exactly one time.