Fix memory corruption when translating Refresh text #287

Merged
WizardCM merged 1 commit from fix-context-crash into master 2021-04-17 14:58:34 -05:00
WizardCM commented 2021-04-16 20:51:12 -05:00 (Migrated from github.com)

Description

After testing a variety of solutions, including moving everything into the Qt/UI thread, it seems .toStdString() was causing memory corruption. Using .toUtf8().constData() directly seems to solve the issue.

Motivation and Context

This fixes a crash / memory corruption.

How Has This Been Tested?

Right click on a browser panel on Windows.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
### Description After testing a variety of solutions, including moving everything into the Qt/UI thread, it seems `.toStdString()` was causing memory corruption. Using `.toUtf8().constData()` directly seems to solve the issue. ### Motivation and Context This fixes a crash / memory corruption. ### How Has This Been Tested? Right click on a browser panel on Windows. ### Types of changes - Bug fix (non-breaking change which fixes an issue) ### Checklist: - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [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.
notr1ch (Migrated from github.com) reviewed 2021-04-16 20:51:12 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!287
No description provided.