Click here to Skip to main content
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 4:26am
IviKAZAZI1.4K
Edited 23-Jul-12 4:31am
Nueman8.3K
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)

  Print Answers RSS
0 CPallini 385
1 Sergey Alexandrovich Kryukov 262
2 OriginalGriff 200
3 George Jonsson 134
4 Richard MacCutchan 110
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,890
2 CPallini 5,175
3 George Jonsson 3,559
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 23 Jul 2012
Copyright © CodeProject, 1999-2014
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