Hey there,
Using 5.3-192
Was playing with custom stateful regions, and used this pattern of having a Context
class as a region input pin to pass data to it. The region implements a custom interface.
When deleting this Context
class from my Definitions, VL throws the following exception and goes to some kind of broken state :
Exception
NullReferenceException: "Object reference not set to an instance of an object."
StackTrace:
VL.Lang.View.ControlPointView { protected virtual void SetModel(VL.Model.Element oldValue, VL.Model.Element value) { ... } }
VL.Lang.View.DataHubView { public virtual void set_Model(VL.Model.Element value) { ... } }
VL.Lang.View.CompoundView+<>c { internal void <SetModel>b__39_1(VL.Lang.View.ControlPointView v, VL.Model.ControlPoint m) { ... } }
VL.Lang.RestoreViewHelpers+Synchronizer`2 { public void Update(System.Collections.Generic.IEnumerable<> input, System.Func<, > create, System.Action<, > updator) { ... } }
VL.Lang.View.CompoundView { protected virtual void SetModel(VL.Model.Element oldValue, VL.Model.Element value) { ... } }
VL.Lang.View.PatchView { protected virtual void SetModel(VL.Model.Element oldValue, VL.Model.Element value) { ... } }
VL.Lang.View.RegionView+<>c { internal void <SetModel>b__71_1(VL.Lang.View.PatchView v, VL.Model.Patch m) { ... } }
VL.Lang.RestoreViewHelpers+Synchronizer`2 { public void Update(System.Collections.Generic.IEnumerable<> input, System.Func<, > create, System.Action<, > updator) { ... } }
VL.Lang.View.RegionView { protected virtual void SetModel(VL.Model.Element oldValue, VL.Model.Element value) { ... } }
VL.Lang.View.CompoundView+<>c { internal void <SetModel>b__39_9(VL.Lang.View.RegionView v, VL.Model.Node m) { ... } }
VL.Lang.RestoreViewHelpers+Synchronizer`2 { public void Update(System.Collections.Generic.IEnumerable<> input, System.Func<, > create, System.Action<, > updator) { ... } }
VL.Lang.View.CompoundView { protected virtual void SetModel(VL.Model.Element oldValue, VL.Model.Element value) { ... } }
VL.Lang.View.CanvasView { protected virtual void SetModel(VL.Model.Element oldValue, VL.Model.Element value) { ... } }
VL.HDE.PatchEditor.EditorControl { internal void SetSolution(VL.Model.Solution newSolution) { ... } }
VL.HDE.PatchEditor.EditorControl+<Session_SolutionUpdatedAsync>d__136 { private virtual void MoveNext() { ... } }
System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } }
Microsoft.VisualStudio.Threading.TplExtensions+<InvokeAsync>d__18`1 { private virtual void MoveNext() { ... } }
AggregateException: "One or more errors occurred. (Object reference not set to an instance of an object.)"
InnerExceptions: "1"
StackTrace:
Microsoft.VisualStudio.Threading.TplExtensions+<InvokeAsync>d__18`1 { private virtual void MoveNext() { ... } }
System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } }
VL.Model.VLSession+<OnSolutionUpdatedAsync>d__207 { private virtual void MoveNext() { ... } }
System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } }
VL.Model.VLSession+<UpdateSolutionAndRaiseEventIfChangedAsync>d__193 { private virtual void MoveNext() { ... } }
System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } }
System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } }
VL.Model.VLSession+<UpdateCompilationAsync>d__192 { private virtual void MoveNext() { ... } }
When this happens, all links from my Application patch are gone. I tried to move a node and then pressed ALT+F4, but vvvv would not quit. Instead, it would glitch, see the following capture :
If saving the patch in this state, it cannot be open anymore. The Exception shows up and the patch does not even open.
I have attached a small repro patch for debugging. To repro :
- Open
UnrecoverablePatch.vl
- Go to the Definitions, delete the
BlahContext
class - Exception is thrown, go back to Application : all links are gone
- Move one of the nodes
- Try to
ALT + F4
: the editor glitches - If you save the patch, you won’t be able to open it anymore
UnrecoverablePatch.vl (30.4 KB)
Cheers!