Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions EmoTracker.Data/AutoTracking/LuaMemorySegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public LuaMemorySegment() : base()

protected override void OnSegmentDataUpdated()
{
base.OnSegmentDataUpdated();

var state = this.OwnerState as Sessions.TrackerState;
if (state == null) return;
var scripts = state.Scripts;
Expand All @@ -76,10 +74,15 @@ protected override void OnSegmentDataUpdated()
{
try
{
object[] result;
using (new LocationDatabase.SuspendRefreshScope(state.Locations))
{
scripts.SafeCall(callback, this);
result = scripts.SafeCall(callback, this);
}
bool succeeded = result != null && result.Length > 0
&& result[0] != null && !(result[0] is bool b && !b);
if (succeeded)
Dirty = false;
}
catch (Exception ex)
{
Expand Down
6 changes: 2 additions & 4 deletions EmoTracker.Data/AutoTracking/MemorySegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace EmoTracker.Data.AutoTracking
/// data (override <see cref="OnSegmentDataUpdated"/>).
/// </para>
/// </summary>
public class MemorySegment : ModelTypeBase, IMemorySegment, IUpdateWithConnector, IDisposable
public abstract class MemorySegment : ModelTypeBase, IMemorySegment, IUpdateWithConnector, IDisposable
{
#region -- Global Event Hooks --

Expand Down Expand Up @@ -339,9 +339,7 @@ public MemoryUpdateResult UpdateWithConnector(IAutoTrackingProvider provider, Pa
/// overrides to dispatch onto the UI thread and SafeCall the
/// pack-supplied LuaFunction callback.
/// </summary>
protected virtual void OnSegmentDataUpdated()
{
}
protected abstract void OnSegmentDataUpdated();

public override void Dispose()
{
Expand Down
2 changes: 2 additions & 0 deletions EmoTracker.Data/Debugging/LuaDebuggee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@ void ServeRequest(DebugRequest req)

internal void EnterExceptionPause(string errMessage, string traceback)
{
if (!(LuaDebugServer.Instance?.HasActiveSession ?? false)) return;

// Always log so we can confirm the upcall actually
// reached us — the Lua-side handler's pcall around the
// upcall would otherwise silently swallow any throw.
Expand Down
Loading