obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

UI: Return std::optional from ParseThemeMeta

Open derrod opened this issue 1 year ago • 0 comments

Description

Use std::optional as a return value instead of a pointer, thus avoiding any manual memory management shenanigans.

Motivation and Context

Want to avoid errors like the one fixed by #10838

This function could probably throw an exception to signal the error, but it currently doesn't and I don't want to make too many changes.

How Has This Been Tested?

Verified themes still work.

Types of changes

  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

derrod avatar Jun 12 '24 21:06 derrod