[Mono-dev] MonoDvelop IDE crash

Abir Bhattacharya abirb at 2pirad.com
Mon Sep 17 06:53:03 EDT 2007


Hi all

I have removed the System.Timers event calls and have replaced them with
Glib.Add.TimeoutHandler. 

But it seems that the event does not fire up at all, and I only get to see
the first of the runtime generated images : (Atleast the application does
not hang anymore after removing the Timers events:-)  

public partial class DynDisp : Form
    {
        ColMatrix[] cM;
        ArrayList a2;
        private  int Cntr = 0;
        EnCodeStr enS = new EnCodeStr();
        private  int intCtr = 0;
        System.Timers.Timer t1 = new System.Timers.Timer();
        //static Graphics gr;
        
        #region Resvars
        private int ScrX = 0;
        private int ScrY = 0;
        private int lrpad = 0;
        private int DimCell = 0; // the cells are square , hnce
width=height=x
        private const int CellCnt = 32;

        #endregion
		Int32 timecnt;
        bool stoptimer;


        public DynDisp()
        {
            InitializeComponent();
            
        }
            
        
        public DynDisp(ColMatrix[] ColM,ArrayList a)
        {
            InitializeComponent();

            #region ScreenResolution Calc

            ScrX = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
            ScrY = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

            lrpad = ScrX / 100 * 9; // 9% of the width res
            DimCell = ((ScrX - (lrpad * 2)) / (CellCnt + 1));
            
            #endregion
            

            //EnCode = x;
            cM = (ColMatrix[])ColM.Clone();
            a2 =  a;
            Cntr = a2.Count;
            
            this.WindowState = FormWindowState.Maximized;
            
            this.BackColor = System.Drawing.Color.White;
            //this.Cursor.Dispose();
			
           /* t1.Interval = 100;
            t1.Elapsed += new ElapsedEventHandler(t1Elapsed);

            t1.Enabled = true; */
            
            timerSetup();
            StartClock();
            
            
        }

void StartClock()
        {
        	if(stoptimer)
        	{
        	stoptimer=false;
        		
		GLib.Timeout.Add(1000,new GLib.TimeoutHandler(update_stat));

            	MessageBox.Show("IN...");
            }
        }
        private void timerSetup()
        {
        	timecnt=1;
        	stoptimer=true;
        }
        //private void t1Elapsed(object source, ElapsedEventArgs e)
        bool update_stat()
        {
            
               MessageBox.Show("GOL "+intCtr.ToString());
                if (intCtr == Cntr - 1)
                {
                    intCtr = 0;
                    
                    
                }
                this.Invalidate();
                intCtr++;
                
               
            return !stoptimer;
            
        }
        

        protected override void OnPaint(PaintEventArgs e)
        {
            
            base.OnPaint(e);

            try
            {
				
 
PaintFinalRect(enS.EnCodeString((string)a2[intCtr]), e.Graphics);

            }

            catch (System.Exception)
            {
				
            }

			

        }



        
        

        private void PaintFinalRect(string EncStr,Graphics g)
        {
		:
		:

	 }

-----Original Message-----
From: Lluis Sanchez [mailto:lluis at ximian.com] 
Sent: Saturday, September 15, 2007 1:02 AM
To: Abir Bhattacharya
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] MonoDvelop IDE crash

El dv 14 de 09 del 2007 a les 17:42 +0530, en/na Abir Bhattacharya va
escriure:
> Hi,
> 
>  
> 
> I have a C# application(usage of extensive graphics) which I am
> porting to mono . The applications generates runtime images on the
> OnPaint() method ,however when it runs in mono ,Linux 2.6 the
> application hangs along with the monodevelop IDE . In some of the
> instances the images are painted once or twice and then it crashes(the
> IDE too) . 
> 
>  
> 
> Is it a problem with my mono installation (1.2.3 -JIT version)? Is
> there any way I can debug my application ? How can I check memory
> leaks with mono?

Without more information like error messages or stack traces it is
impossible to know what's the problem. Try starting MonoDevelop from a
terminal and see the errors shown there.

Lluis.

> 





-- Visit us at http://www.2pirad.com/ --



More information about the Mono-devel-list mailing list