Skip to content

Commit d151d4f

Browse files
author
livecodeali
committed
Merge remote-tracking branch 'upstream/develop-7.0' into develop
2 parents 2d03812 + 1d43036 commit d151d4f

15 files changed

Lines changed: 144 additions & 73 deletions

docs/notes/bugfix-14642.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# IDE crashes after deleting a control, reverting to the saved stack, and using the project Browser

docs/notes/bugfix-15456.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# libURL handles Content-Transfer-Encoding incorrectly

docs/notes/bugfix-15467.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Memory leak in MCPlayer::resolveplayerfilename
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ability to set the dontUseQT property for a player object (windows only)
2+
3+
It is now possible to set the dontUseQT property for a player object. On Windows,
4+
the default value of the dontUseQt (global) property is false. This means that any
5+
player object created will use the QuickTime API for multimedia playback. With this
6+
new feature, you can set the dontUseQT property of a player to true, without changing
7+
the value of the global dontUseQt property. In that way you can have both QuickTime
8+
and non-QuickTime players playing at the same time.
9+

engine/src/exec-interface-player.cpp

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,19 @@ bool MCPlayer::resolveplayerfilename(MCStringRef p_filename, MCStringRef &r_file
263263
return true;
264264
}
265265

266-
MCAutoStringRef t_filename;
267-
bool t_relative_to_stack = getstack()->resolve_relative_path(p_filename, &t_filename);
268-
if (t_relative_to_stack && MCS_exists(*t_filename, True))
269-
return MCStringCopy(*t_filename, r_filename);
266+
{
267+
MCAutoStringRef t_filename;
268+
bool t_relative_to_stack = getstack()->resolve_relative_path(p_filename, &t_filename);
269+
if (t_relative_to_stack && MCS_exists(*t_filename, True))
270+
return MCStringCopy(*t_filename, r_filename);
271+
}
270272

271-
bool t_relative_to_default_folder = getstack()->resolve_relative_path_to_default_folder(p_filename, &t_filename);
272-
if (t_relative_to_default_folder && MCS_exists(*t_filename, True))
273-
return MCStringCopy(*t_filename, r_filename);
273+
{
274+
MCAutoStringRef t_filename;
275+
bool t_relative_to_default_folder = getstack()->resolve_relative_path_to_default_folder(p_filename, &t_filename);
276+
if (t_relative_to_default_folder && MCS_exists(*t_filename, True))
277+
return MCStringCopy(*t_filename, r_filename);
278+
}
274279

275280
return false;
276281
}
@@ -758,3 +763,13 @@ void MCPlayer::GetStatus(MCExecContext& ctxt, intenum_t& r_status)
758763

759764
}
760765
#endif
766+
767+
void MCPlayer::SetDontUseQT(MCExecContext &ctxt, bool p_dont_use_qt)
768+
{
769+
setdontuseqt(p_dont_use_qt);
770+
}
771+
772+
void MCPlayer::GetDontUseQT(MCExecContext &ctxt, bool &r_dont_use_qt)
773+
{
774+
getdontuseqt(r_dont_use_qt);
775+
}

engine/src/object.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,24 @@ Boolean MCObject::del()
829829
{
830830
MCParentScript::FlushObject(this);
831831
m_is_parent_script = false;
832-
}
832+
}
833+
834+
// SN-2015-06-04: [[ Bug 14642 ]] These two blocks have been moved from
835+
// MCObject::scheduledelete, since a deleted object is no longer something
836+
// we want to listen to. In case we undo the deletion, it will be added
837+
// back to the list of listened objects; in case we revert the stack to its
838+
// saved state, we will now be left with a list of listened-to objects with
839+
// no dangling pointers.
840+
if (m_weak_handle != nil)
841+
{
842+
m_weak_handle -> Clear();
843+
m_weak_handle = nil;
844+
}
845+
846+
// MW-2012-10-10: [[ IdCache ]] Remove the object from the stack's id cache
847+
// (if it is in it!).
848+
if (m_in_id_cache)
849+
getstack() -> uncacheobjectbyid(this);
833850

834851
return True;
835852
}
@@ -4978,17 +4995,6 @@ void MCObject::scheduledelete(bool p_is_child)
49784995
{
49794996
if (!p_is_child)
49804997
appendto(MCtodelete);
4981-
4982-
if (m_weak_handle != nil)
4983-
{
4984-
m_weak_handle -> Clear();
4985-
m_weak_handle = nil;
4986-
}
4987-
4988-
// MW-2012-10-10: [[ IdCache ]] Remove the object from the stack's id cache
4989-
// (if it is in it!).
4990-
if (m_in_id_cache)
4991-
getstack() -> uncacheobjectbyid(this);
49924998
}
49934999

49945000
MCRectangle MCObject::measuretext(MCStringRef p_text, bool p_is_unicode)

engine/src/player-interface.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class MCPlayerInterface
8080
uint2 formattedwidth;
8181
uint2 formattedheight;
8282
uint2 loudness;
83-
int4 lasttime;
83+
int4 lasttime;
84+
Boolean dontuseqt;
85+
Boolean usingqt;
8486

8587
public:
8688
MCPlayerInterface(){};
@@ -125,6 +127,9 @@ class MCPlayerInterface
125127
scale = s;
126128
}
127129

130+
void setdontuseqt(bool p_dont_use_qt) { dontuseqt = p_dont_use_qt; }
131+
void getdontuseqt(bool &r_dont_use_qt) { r_dont_use_qt = dontuseqt; }
132+
128133
virtual Boolean prepare(MCStringRef options) = 0;
129134
virtual Boolean playstart(MCStringRef options) = 0;
130135
virtual Boolean playpause(Boolean on) = 0;
@@ -266,6 +271,9 @@ class MCPlayerInterface
266271
virtual void GetForeColor(MCExecContext& ctxt, MCInterfaceNamedColor& r_color) = 0;
267272
virtual void SetHiliteColor(MCExecContext& ctxt, const MCInterfaceNamedColor& p_color) = 0;
268273
virtual void GetHiliteColor(MCExecContext& ctxt, MCInterfaceNamedColor& r_color) = 0;
274+
275+
virtual void GetDontUseQT(MCExecContext& ctxt, bool &p_dont_use_qt) = 0;
276+
virtual void SetDontUseQT(MCExecContext& ctxt, bool r_dont_use_qt) = 0;
269277
};
270278

271279

0 commit comments

Comments
 (0)