c# - StackOverflowException in multi-threaded UI update application -
i have application bunch of jobs off working (await task.whenall...) , updating progress section of form.
i've noticed when running particularly fast (e.g. when there not processing do, checks), i'm getting following exception thrown:
the invokerequired helper method 1 found on site while ago , looks this:
internal static void invokeifrequired<t>(this t control, action<t> action) t : isynchronizeinvoke { if (control.invokerequired) { control.invoke(new action(() => action(control)), null); } else { action(control); } }
could tell me why assigning label text value causing stackoverflowexception please?
edit: here detail of exception
there 2 situations:
- you requests workflow update info , breaks application - in case need known 'debouncing' - when request don't execute update set timer let's 200 ms , cancel previous timer , timer executes update, way ensure update can't happen more once in 200 ms won't break app. can more complicated if new requests in less 200ms long periods of time, need implement logic update , not trigger timer.
- you have circular reference causing code execute multiple times (but if case exceptions always) - can check using debugger , checking stack calls problematic code.
Comments
Post a Comment