c# - "The input array was empty" ArgumentException when making a invoked cross thread call -


i have 2 separate threads , need call members other thread. via normal method of invoking. here's basic setup:

void foo() //on thread 1 {      if (this.invokerequired)           this.invoke(new action(foo2));      else           foo2(); }  void foo2(){/*do work*/} //accesses members on thread 2 

i'm getting error "argumentexception unhandled: input array empty". thing is, method i'm trying invoke has no parameters, , per documentation, shouldn't issue.

i tried replacing:

this.invoke(new action(foo2)); 

with

this.invoke(new action(foo2), null); 

(the documentation says if there no parameters, pass null, , i'm still getting same error)

here's top of stacktrace:

at system.windows.forms.control.marshaledinvoke(control caller, delegate method, object[] args, boolean synchronous) @ system.windows.forms.control.invoke(delegate method, object[] args)

so, says array (for parameters presume) empty, in fact correct because i'm calling method no parameters... what's catch here?


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -