Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 1ebfc53

Browse files
committed
[[ Cleanup ]] Remove MCNameDelete
This patch removes uses of MCNameDelete, replacing them with direct calls to MCValueRelease (which is all MCNameDelete did).
1 parent 2ec3a42 commit 1ebfc53

32 files changed

+479
-485
lines changed

engine/src/block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ void MCBlock::freeatts()
18371837
freerefs();
18381838
// MW-2012-02-17: [[ SplitTextAttrs ]] Free the fontname name if we have that attr.
18391839
if (flags & F_HAS_FNAME)
1840-
MCNameDelete(atts -> fontname);
1840+
MCValueRelease(atts -> fontname);
18411841
if (flags & F_HAS_COLOR)
18421842
delete atts->color;
18431843
if (flags & F_HAS_BACK_COLOR)

engine/src/dsklnx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ class MCLinuxDesktop: public MCSystemInterface
19401940
sigaction(SIGCHLD, &action, NULL);
19411941
while (MCnprocesses--)
19421942
{
1943-
MCNameDelete(MCprocesses[MCnprocesses] . name);
1943+
MCValueRelease(MCprocesses[MCnprocesses] . name);
19441944
MCprocesses[MCnprocesses] . name = nil;
19451945
if (MCprocesses[MCnprocesses].pid != 0
19461946
&& (MCprocesses[MCnprocesses].ihandle != NULL

engine/src/dskmac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4552,7 +4552,7 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
45524552
sigaction(SIGCHLD, &action, NULL);
45534553
while (MCnprocesses--)
45544554
{
4555-
MCNameDelete(MCprocesses[MCnprocesses] . name);
4555+
MCValueRelease(MCprocesses[MCnprocesses] . name);
45564556
MCprocesses[MCnprocesses] . name = nil;
45574557
if (MCprocesses[MCnprocesses].pid != 0
45584558
&& (MCprocesses[MCnprocesses].ihandle != NULL

engine/src/exec-interface-field-chunk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3248,7 +3248,7 @@ void MCBlock::SetTextFont(MCExecContext& ctxt, MCStringRef p_fontname)
32483248
flags &= ~F_HAS_FNAME;
32493249
if (atts != nil)
32503250
{
3251-
MCNameDelete(atts -> fontname);
3251+
MCValueRelease(atts -> fontname);
32523252
atts -> fontname = nil;
32533253
}
32543254
}

engine/src/exec-interface-stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ void MCStack::SetMenuBar(MCExecContext& ctxt, MCStringRef p_menubar)
15101510

15111511
if (t_success && !MCNameIsEqualTo(getmenubar(), *t_new_menubar, kMCCompareCaseless))
15121512
{
1513-
MCNameDelete(_menubar);
1513+
MCValueRelease(_menubar);
15141514
t_success = MCNameClone(*t_new_menubar, _menubar);
15151515
if (t_success)
15161516
{

engine/src/exec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5676,7 +5676,7 @@ template<> struct MCExecValueTraits<MCNameRef>
56765676
self . nameref_value = p_value;
56775677
}
56785678

5679-
inline static void release(MCNameRef& self) { MCNameDelete(self); }
5679+
inline static void release(MCNameRef& self) { MCValueRelease(self); }
56805680
inline static MCNameRef retain(MCNameRef& self) { return MCValueRetain(self); }
56815681

56825682
inline static bool eval(MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCNameRef& r_value)

engine/src/external.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ MCExternalHandlerList::~MCExternalHandlerList(void)
4444
MCExternal::Unload(m_externals[i]);
4545

4646
for(uint32_t i = 0; i < m_handlers . Count(); i++)
47-
MCNameDelete(m_handlers[i] . name);
47+
MCValueRelease(m_handlers[i] . name);
4848
}
4949

5050
bool MCExternalHandlerList::IsEmpty(void)

engine/src/externalv0.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ static char *set_array_utf8(const char *arg1, const char *arg2,
15921592
}
15931593
var.set_on_path(*MCECptr, {&t_key, 1}, *t_string);
15941594

1595-
MCNameDelete(t_key);
1595+
MCValueRelease(t_key);
15961596
}
15971597
return NULL;
15981598
}

engine/src/externalv1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,7 @@ static MCExternalError MCExternalObjectDispatch(MCExternalObjectRef p_object, MC
24712471
}
24722472
}
24732473

2474-
MCNameDelete(t_message_as_name);
2474+
MCValueRelease(t_message_as_name);
24752475

24762476
while(t_params != nil)
24772477
{

engine/src/fieldhtml.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ static void import_html_free_style(MCFieldCharacterStyle& p_style)
10441044
MCValueRelease(p_style . link_text);
10451045
MCValueRelease(p_style . image_source);
10461046
MCValueRelease(p_style . metadata);
1047-
MCNameDelete(p_style . text_font);
1047+
MCValueRelease(p_style . text_font);
10481048
}
10491049

10501050
static bool import_html_equal_style(const MCFieldCharacterStyle& left, const MCFieldCharacterStyle& right)
@@ -1733,7 +1733,7 @@ static void import_html_change_style(import_html_t& ctxt, const import_html_tag_
17331733
{
17341734
t_style . has_text_font = true;
17351735
if (t_style . text_font != nil)
1736-
MCNameDelete(t_style . text_font);
1736+
MCValueRelease(t_style . text_font);
17371737
MCNameCreate(p_tag . attrs[i] . value, t_style . text_font);
17381738
}
17391739
break;

0 commit comments

Comments
 (0)