×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2007
    Location
    France, Marseille
    Posts
    23

    Crash with multiple ao_timer

    My program crash with in a very simple program that involve ao_timer.

    I use the menu to send a loop with a timer.
    When I start the program, if I do repeatedly menu action, the program crash (in my case : only after I press 10 times the menu).

    The loop function is :
    Code:
    def Loop_Timer(iTimer):
        tim = e32.Ao_timer()	
        for i in range(10):
            print "Timer %d #%d"%(iTimer, i)
            tim.after(1)
    The main program is:
    Code:
    global iTimer
    iTimer = 0
    
    def hld_Loop_Timer():
        global iTimer
        iTimer += 1
        Loop_Timer(iTimer)        
    
    appuifw.app.menu = [(u"Loop Timer", hld_Loop_Timer)]
    
    app_lock = e32.Ao_lock()
    I'm working on a N70 symbian 2nd Ed.

    Has any one a solution ?
    Is it a problem specific to N70 ou 2nd Ed ?

    PS : I had to do this program to identify a critical issue I have in a real application i wrote.

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: Crash with multiple ao_timer

    Hello noreli

    I tried your code. Somehow it didn't work out.May be having the same problem as in with you but when i modifies the code a little and called the function hld_Loop_Timer() more then once then too it works fine.
    >>>
    Timer 1 #0
    Timer 1 #1
    Timer 1 #2
    Timer 1 #3
    Timer 1 #4
    Timer 1 #5
    Timer 1 #6
    Timer 1 #7
    Timer 1 #8
    Timer 1 #9
    Timer 2 #0
    Timer 2 #1
    Timer 2 #2
    Timer 2 #3
    Timer 2 #4
    Timer 2 #5
    Timer 2 #6
    Timer 2 #7
    Timer 2 #8
    Timer 2 #9
    >>>
    See thats the ouput I got and I thinks thats perfect as the system doent crash on the sencond timer.
    I used the following modified code.

    Code:
    import e32,appuifw
    
    def Loop_Timer(iTimer):
        tim = e32.Ao_timer()	
        for i in range(10):
            print "Timer %d #%d"%(iTimer, i)
            tim.after(1)
    
    global iTimer
    iTimer = 0
    
    def hld_Loop_Timer():
        global iTimer
        iTimer += 1
        Loop_Timer(iTimer)        
    
    hld_Loop_Timer()
    hld_Loop_Timer()
    Can you share where do you wish to use such a feature?

    Hope that helps

    Best Regards
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Registered User
    Join Date
    Jul 2007
    Location
    France, Marseille
    Posts
    23

    Re: Crash with multiple ao_timer

    Well, I knew that your solution would work. I turned around a lot before finding what's not working.

    I use python to make an automate that works for months plugged with a solar pannel and retrieving local datas.
    The automate performs a loop with timers and can be commanded through sms.
    It exchanges files with a web server to transmit data collected or see new orders to perform from the server.

    Some times I observe some crashes (when many SMS are sent together and iapconnect go in timeout). And as my hardware is very hard to reach (because remote), i want to be sure the code has no chance to crash.

Similar Threads

  1. error about multiple definition of vtable and typeinfo
    By sslsslssl in forum Symbian C++
    Replies: 3
    Last Post: 2012-06-20, 11:48
  2. multiple target patterns
    By ukelady in forum Symbian C++
    Replies: 5
    Last Post: 2009-07-23, 09:03
  3. Replies: 5
    Last Post: 2007-04-09, 19:08
  4. N91 multiple REALISED Players crash the application
    By GringoCroco in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2006-05-31, 06:12
  5. Multiple consecutive notes crash ?
    By Jeepy in forum Symbian C++
    Replies: 2
    Last Post: 2004-07-23, 07:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •