Skip to content

Commit 9a890c5

Browse files
Turn MCmbstackptr into an object handle
1 parent f704dce commit 9a890c5

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

engine/src/debug.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ Boolean MCtracereturn = True;
5454
uint4 MCtraceuntil = MAXUINT2;
5555
uint2 MCtracedelay = 500;
5656

57-
// MW-2004-11-17: Added to allow deletion of Message Box
58-
MCStack *MCmbstackptr = NULL;
57+
MCStackHandle MCmbstackptr = nil;
5958

6059
Breakpoint *MCbreakpoints = nil;
6160
uint2 MCnbreakpoints = 0;
@@ -146,10 +145,10 @@ void MCB_setmsg(MCExecContext &ctxt, MCStringRef p_string)
146145
if (!MCModeHandleMessageBoxChanged(ctxt, p_string))
147146
{
148147
// MW-2004-11-17: Now use global 'MCmbstackptr' instead
149-
if (MCmbstackptr == NULL)
148+
if (!MCmbstackptr)
150149
MCmbstackptr = MCdispatcher->findstackname(MCN_messagename);
151150

152-
if (MCmbstackptr != NULL)
151+
if (MCmbstackptr)
153152
{
154153
Window_mode newmode = MCmbstackptr->userlevel() == 0 ? WM_MODELESS
155154
: (Window_mode)(MCmbstackptr->userlevel() + WM_TOP_LEVEL_LOCKED);

engine/src/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ extern int4 MCdropchar;
228228
extern MCImageHandle MCactiveimage;
229229
extern MCImageHandle MCeditingimage;
230230
extern MCTooltipHandle MCtooltip;
231-
extern MCStack *MCmbstackptr;
231+
extern MCStackHandle MCmbstackptr;
232232

233233
extern MCUIDC *MCscreen;
234234
extern MCPrinter *MCprinter;

engine/src/mode_development.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ bool MCModeHandleMessageBoxChanged(MCExecContext& ctxt, MCStringRef p_string)
678678
t_msg_box = MCmessageboxredirect;
679679
else
680680
{
681-
if (MCmbstackptr == nil)
681+
if (!MCmbstackptr)
682682
MCmbstackptr = MCdispatcher->findstackname(MCN_messagename);
683683
t_msg_box = MCmbstackptr;
684684
}

engine/src/stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ MCStack::~MCStack()
602602
i++;
603603
// MW-2004-11-17: If this is the current Message Box, set to NULL
604604
if (MCmbstackptr == this)
605-
MCmbstackptr = NULL;
605+
MCmbstackptr = nil;
606606
if (MCtopstackptr == this)
607607
{
608608
MCtopstackptr = nil;

0 commit comments

Comments
 (0)