[Scummvm-git-logs] scummvm master -> af71986c6e44a5a18bda9af11b5a2ea3a25b9449
digitall
noreply at scummvm.org
Wed May 15 18:55:07 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
af71986c6e BAGEL: Fix Dangling Pointer GCC Compiler Warnings
Commit: af71986c6e44a5a18bda9af11b5a2ea3a25b9449
https://github.com/scummvm/scummvm/commit/af71986c6e44a5a18bda9af11b5a2ea3a25b9449
Author: D G Turner (digitall at scummvm.org)
Date: 2024-05-15T19:53:05+01:00
Commit Message:
BAGEL: Fix Dangling Pointer GCC Compiler Warnings
The CRect structure can not be within the local scope as this will
be freed / destructed at the end of the scope, but the pRect pointer
will still be pointing at this causing a possible crash when this is
used later in this method.
Changed paths:
engines/bagel/boflib/gui/dialog.cpp
diff --git a/engines/bagel/boflib/gui/dialog.cpp b/engines/bagel/boflib/gui/dialog.cpp
index 6e2c9850510..dbf0c453ea1 100644
--- a/engines/bagel/boflib/gui/dialog.cpp
+++ b/engines/bagel/boflib/gui/dialog.cpp
@@ -107,13 +107,14 @@ ErrorCode CBofDialog::create(const char *pszName, CBofRect *pRect, CBofWindow *p
assert(isValidObject(this));
assert(pszName != nullptr);
+ CBofRect cRect;
int x = 0;
int y = 0;
int nWidth = USE_DEFAULT;
int nHeight = USE_DEFAULT;
if ((pRect == nullptr) && (_pBackdrop != nullptr)) {
- CBofRect cRect = _pBackdrop->getRect();
+ cRect = _pBackdrop->getRect();
pRect = &cRect;
}
More information about the Scummvm-git-logs
mailing list