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

Commit 0b4ea78

Browse files
committed
Updates after Seb's feedback #2
1 parent 480d8d5 commit 0b4ea78

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

engine/src/mbliphonedc.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,11 @@ static void do_iphone_font_create(void *p_env)
761761
if (t_base_font != nil)
762762
sprintf(t_base_name, "%s", [[t_base_font fontName] cStringUsingEncoding: NSMacOSRomanStringEncoding]);
763763
else
764-
/* UNCHECKED */ MCStringConvertToCString(*p_name, (char*&)t_base_name);
764+
{
765+
MCAutoPointer<char> t_name;
766+
/* UNCHECKED */ MCStringConvertToCString(*p_name, &t_name);
767+
strcpy(t_base_name, *t_name);
768+
}
765769

766770
if (p_bold && p_italic)
767771
{

engine/src/mbliphonedialog.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ static void dopopupanswerdialog_postwait(void *p_context)
154154
return -1;
155155

156156
popupanswerdialog_t ctxt;
157+
/* UNCHECKED */ MCMemoryAllocate(p_button_count * sizeof(MCStringRef), ctxt . buttons);
157158
ctxt . buttons = p_buttons;
158159
for (uindex_t i = 0; i < p_button_count; i++)
159160
ctxt . buttons[i] = MCValueRetain(p_buttons[i]);
@@ -172,6 +173,7 @@ static void dopopupanswerdialog_postwait(void *p_context)
172173

173174
for (uindex_t i = 0; i < p_button_count; i++)
174175
MCValueRelease(ctxt . buttons[i]);
176+
/* UNCHECKED */ MCMemoryDeallocate(ctxt . buttons);
175177
MCValueRelease(ctxt . title);
176178
MCValueRelease(ctxt . message);
177179
return ctxt . result;

0 commit comments

Comments
 (0)