Click here to Skip to main content
11,481,916 members (62,378 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.5 VS2008 C# Mobile
Hello all,
I'm developing a windows mobile app and I often get a StackOverflowException. For what I can see, is that it comes because a lot a forms remain open, even when I dispose them every time I open a new one. I use a global class to get values from one form to another. Any idea why I get this exception? I don't have loops or things like this.

Thanks in advance.
Posted 23-Jul-12 5:26am
IviKAZAZI1.5K
Edited 23-Jul-12 5:31am
Nueman8.8K
v3
Comments
Rajesh Varma Buddaraju at 23-Jul-12 10:37am
   
Provide your code if possible so that way it will be easy to trace.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It generally isn't loops that cause Stack Overflow - it's unterminated recursion.

Check your code: is there anywhere where a method calls itself, directly or indirectly?
  Permalink  
Comments
IviKAZAZI at 23-Jul-12 10:37am
   
No,i dont think so. Could it be the form load event the cause? Because i have some piece of code there,where i do some checking,some if else etc. The function i recall in the code is the datagrid_fill to update it,after adding some rows in db.
OriginalGriff at 23-Jul-12 10:52am
   
Without actually seeing it? Can't say! :laugh:
Sergey Alexandrovich Kryukov at 23-Jul-12 16:49pm
   
Stack has nothing to do with open forms; it affects the volume of heap memory and unmanaged resources, not stack.
I may not thing so, but your problem is recursion.
--SA
Sergey Alexandrovich Kryukov at 23-Jul-12 16:49pm
   
It's recursion; my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 23 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100