[Mono-dev] Strange bug in System.Timers.Timer i guess

Robert Jordan robertj at gmx.net
Thu Dec 29 10:04:57 EST 2005


Robert Jordan wrote:
> gigi gogu wrote:
> 
>> Hy guys,
>>   I'm trying to port a windows.forms software in gtk with mono, and  
>> everything was ok until i tried to implement two timers.... That made  
>> my application crush without a reason after a while.  Here is the  
>> message i received
> 
> 
> 
> You should use the non-multithreaded System.Windows.Forms.Timer.

Oops! Sorry, I overlooked "to port a windows.forms software to gtk".

I don't know whether gtk# has its own Timer class. If yes,
you should use it. If not, have a look whether there is
a way to schedule the timer event to the thread which created
the GUI objects.

Robert


> 
> Robert
> 
> 
>>   =================================================================
>>   Got a SIGSEGV while executing native code. This usually indicates
>>   a fatal error in the mono runtime or one of the native libraries
>>   used by your application.
>>   =================================================================
>>     Stacktrace:
>>     in <0x4> (wrapper managed-to-native) 
>> Gtk.Container:gtk_container_remove (intptr,
>>   intptr)
>>   in <0xffffffe3> (wrapper managed-to-native) 
>> Gtk.Container:gtk_container_remove (
>>   intptr,intptr)
>>   in <0x3b> Gtk.Container:Remove (WidgGtk.)
>>   in <0x75> pl_gui.myTableList:refresh ()
>>   in <0x13> pl_gui.myTableList:loadMese (pl_db.DB.Lists.dbListaMese)
>>   in <0x180> Forms.frm_Main:refreshMese ()
>>   in <0xa> Forms.frm_Main:on_tmrRefreshMese_Tick 
>> (object,System.Timers.ElapsedEven
>>   tArgs)
>>   in <0xffffff85> (wrapper delegate-invoke) 
>> System.MulticastDelegate:invoke_void_o
>>   bject_ElapsedEventArgs (object,System.Timers.ElapsedEventArgs)
>>   in <0x1d5> System.Timers.Timer:Callback (object)
>>   in <0xffffff95> (wrapper delegate-invoke) 
>> System.MulticastDelegate:invoke_void_o
>>   bject (object)
>>   in <0xf061a8a> (wrapper runtime-invoke) 
>> System.Object:runtime_invoke_void_object
>>    (object,intptr,intptr,intptr)
>>     This application has requested the Runtime to terminate it in an 
>> unusual way.
>>   Please contact the application's support team for more information.
>>     Practicaly, the timer does an refresh on a component on a 
>> specified  interval... that means it removes all widgets inside that 
>> component and  add them again (updated from a database);  The code for 
>> this is  (if it matthers):
>>     private void refresh()
>>   {
>>       int nr = this.Children.Length;
>>       for(int i=nr-1; i>=0; i--){
>>           Widget w=this.Children[i];
>>           try{
>>               this.Remove(w);
>>           }catch(Exception ex){
>>               Console.WriteLine(ex.Message);
>>           }
>>       }
>>       Classes.gdiMasa m;       for (int i = 0; i < lista_mese.Count; i++)
>>       {
>>           m = new Classes.gdiMasa(lista_mese.getMasa(i));
>>           this.Put(m,m.db_masa.pozX,m.db_masa.pozY);
>>           m.myClick +=ev_mese;
>>       }
>>   }
>>          
>> ---------------------------------
>> Yahoo! Photos
>>  Ring in the New Year with Photo Calendars. Add photos, events, 
>> holidays, whatever.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 
> 




More information about the Mono-devel-list mailing list