Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to properly autoshutdown an app
Message
De
30/12/2013 14:18:41
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
30/12/2013 10:52:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01591090
Message ID:
01591104
Vues:
83
Hi Albert

One possibility: if there is any object reference between the form and another object that cannot be released, it would interfere with shutting down. If such object has been instantiated arbitrarily you would only see the app not shutdown when that object was instantiated. This falls under the topic of garbage collection.

Check for any objects that are linked to properties on the form and that have references to the form.

>Hi all,
>
>I have an app that runs on a server and I need it to autoshutdown each night. It *mostly* works but sometimes chokes on trying to shut down so I wonder if I have the code in the right order or right place:
>
>The app has one form and on that form I have a timer that fires every 15 seconds.
>
>In the timer's .timer() method, this code checks the time and tries to shut down after 11 pm:
>
>
>
>IF VAL(LEFT(TIME(),2)) >= 23
>
>   * release this form and then try to clear the read
>  ON ERROR
>  THISFORM .Release()
>
>   ON SHUTDOWN
>   CLEAR EVENTS
>   
>ENDIF
>
>
>
>Questions:
>
>1) is the order correct on the above commands?
>2) should this code be in some method of the form itself?
>3) it does not seem like I need a QUIT most of the time - would this be better?
>
>Thanks,
>
>Albert Gostick
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform