Commit Graph

5 Commits

Author SHA1 Message Date
WarmUpTill
82568b23e8 Fix crash when initially setting up tab ordering
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The tabOrder vector was initialized with the size of tabNames.
Then new tabs were registered with AddSetupTabCallback() causing
tabNames to grow but tabOrder to remain the same.

Usually this is not a problem as LoadTabOrder() will be called which
ensures that their sizes are in sync.

However, when using a fresh OBS install or one with a corrupted scene
configuration file, the on_save() callbacks are called before any
loading callbacks.
With the sizes of tabNames and tabOrder not being in sync this would
lead to a crash.

Fixed by adding a tabWidgetOrderValid() check within SaveTabOrder()
before iterating over both vectors.
The tabWidgetOrderValid() was expanded to check the sizes of both
vectors.
Additionally the tabOrder initialization was moved from global static
initialization to function local static initialization to ensure that
potential preceeding calls to AddSetupTabCallback() will be taken into
account when setting up the tabOrder vector.
2025-07-06 10:19:20 +02:00
WarmUpTill
2247152aa8 Remove legacy tab "Scene Triggers" 2024-09-24 23:00:47 +02:00
WarmUpTill
e729d15e97 Remove legacy tab "Network" 2024-09-24 23:00:47 +02:00
WarmUpTill
5e1469b0d8 Don't restore last opened tab if that tab is no longer visible 2024-06-05 01:05:31 +02:00
WarmUpTill
ce501bd972 Move / add tabWidget related helper functions 2024-05-01 19:44:57 +02:00