Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.StackOverflowException was unhandled - C#, .NET

How to fix it. It look like this page is dedicated to that kind of error.

enter image description here

like image 210
Hooch Avatar asked May 09 '11 15:05

Hooch


2 Answers

Your function is calling itself forever.
You need to make it stop calling itself.

In this case, you need to Invoke it to the UI thread instead of simply calling itself again:

Invoke(new Action(UpdateAdvert));
like image 121
SLaks Avatar answered Sep 21 '22 00:09

SLaks


It appears that InvokeRequired is true. This causes unbounded recursion. There's nothing that will change it to false. Perhaps invoking would fix it?

like image 38
spender Avatar answered Sep 19 '22 00:09

spender