give up on the idea of throwing an exception when attaching a core to a movie. The reason this doesn't work is that restart movie keeps the movie in memory (which was previously attached). This commit decrees that it is safe to keep a movie in memory, and attach to a new instance of the same core. The alternative is that movies would have to save and load on restart which is slow and may not be desired
This commit is contained in:
parent
86ac6eadcc
commit
1f39160999
|
@ -24,15 +24,6 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public virtual void Attach(IEmulator emulator)
|
||||
{
|
||||
// TODO: this check would ideally happen
|
||||
// but is disabled for now because restarting a movie doesn't new one up
|
||||
// so the old one hangs around with old emulator until this point
|
||||
// maybe we should new it up, or have a detach method
|
||||
//if (!Emulator.IsNull())
|
||||
//{
|
||||
// throw new InvalidOperationException("A core has already been attached!");
|
||||
//}
|
||||
|
||||
Emulator = emulator;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,11 +46,6 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public void Attach(IEmulator emulator)
|
||||
{
|
||||
if (!_emulator.IsNull())
|
||||
{
|
||||
throw new InvalidOperationException("A core has already been attached!");
|
||||
}
|
||||
|
||||
if (!emulator.HasSavestates())
|
||||
{
|
||||
throw new InvalidOperationException($"A core must be able to provide an {nameof(IStatable)} service");
|
||||
|
|
Loading…
Reference in New Issue