MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / getWeakRefToMainCanvas

Function getWeakRefToMainCanvas

lib/utils/scene-selection.cpp:243–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243static obs_weak_canvas_t *getWeakRefToMainCanvas()
244{
245 static auto canvas = obs_get_main_canvas();
246 static auto weakCanvas = obs_canvas_get_weak_canvas(canvas);
247 [[maybe_unused]] static const bool _ = []() {
248 // Let's just hope we don't have to deal with selecting scenes
249 // when the OBS main canvas gets deleted and release the
250 // references here already to avoid reporting leaks on shutdown
251 obs_canvas_release(canvas);
252 obs_weak_canvas_release(weakCanvas);
253 return true;
254 }();
255 return weakCanvas;
256}
257
258SceneSelection SceneSelectionWidget::CurrentSelection()
259{

Callers 2

CurrentSelectionMethod · 0.85

Calls 4

obs_get_main_canvasFunction · 0.85
obs_canvas_releaseFunction · 0.85
obs_weak_canvas_releaseFunction · 0.85

Tested by

no test coverage detected