Browse Source

frontend: Fix runtime check failure issue

Fix an issue where the stack around the variable snapEnabled was
corrupted.

SPI_GETSNAPTODEFBUTTON should use BOOL, not bool.

Reference:
 * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow
hongqingwan 3 weeks ago
parent
commit
85fa987f67
1 changed files with 1 additions and 1 deletions
  1. 1 1
      frontend/components/SourceTreeItem.cpp

+ 1 - 1
frontend/components/SourceTreeItem.cpp

@@ -290,7 +290,7 @@ void SourceTreeItem::mouseDoubleClickEvent(QMouseEvent *event)
 			 * the application to hang when double clicking the sources list and the
 			 * the application to hang when double clicking the sources list and the
 			 * Windows setting 'Snap mouse to default button in dialog boxes' is enabled.
 			 * Windows setting 'Snap mouse to default button in dialog boxes' is enabled.
 			 */
 			 */
-			bool snapEnabled;
+			BOOL snapEnabled = FALSE;
 			SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &snapEnabled, 0);
 			SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &snapEnabled, 0);
 
 
 			if (snapEnabled) {
 			if (snapEnabled) {