Author Topic: SYSTEM not close window immediately  (Read 3052 times)

0 Members and 1 Guest are viewing this topic.

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
SYSTEM not close window immediately
« on: January 29, 2020, 07:47:20 am »
Good morning

maybe it has already been written - indeed maybe I had asked for it myself but I do not find the discussion.
The topic is as follows.

SYSTEM ends the program and closes the window immediately (QB64 wiki) but instead it can take many seconds before the window closes !

With version 1.2 I think the closure was instantaneous.
With the 1.3 begins to delay and with the 1.4 nothing has changed.

Do you have any suggestions for me?

Thank You !


Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

FellippeHeitor

  • Guest
Re: SYSTEM not close window immediately
« Reply #1 on: January 29, 2020, 08:12:07 am »
Quote
With version 1.2 I think the closure was instantaneous.

We replaced the c++ backend from v1.2 to v1.3. Can you confirm that in 1.2 it worked differently on your machine? Also, does it happen every time or only with _FULLSCREEN programs?

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: SYSTEM not close window immediately
« Reply #2 on: January 30, 2020, 03:58:37 am »
Thank you Fellippe for the attention, and also for the interesting information.

I'm very sorry but I'm not able to confirm the behavior of code compiled with previous versions.
A few lines of code don't seem to make much difference but, generally, closing with version 1.2 still seems a little faster.

On 1.3-1.4 version, even trying to close the application by closing the window by clicking on the X spends a lot of time.
Behavior seems to be random with the general tendency to last much longer than expected.

In doing the tests I noticed that there seem to be problems in reading INKEY$, especially - but not only - with CHR$(27): sometimes it seems that it has difficulty reading it (with the ESC command, as is logical, I would like you to leave the program). it's a strange behavior!

However it is certain that at the beginning of the development of my programmes this problem had never occurred.

Today it's really nerve-racking having to wait 3 or 4 seconds or moore to close the window at the end of the program

About _FULLSCREEN I don't use it.


____
I use win7 64 professional.

Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: SYSTEM not close window immediately
« Reply #3 on: January 30, 2020, 05:52:08 am »
Disable your antivirus and test to see if the problem persists.  It could be your antivirus is doing some file checking to make certain nothing has infected your system before closing fully.  It may be an issue with Window’s memory management cleaning and freeing memory, and you might need to tweak those settings. 

As time passes, every modern OS tends to download and install more and more features to itself.  Antivirus definitions and checks grow ever larger.  New features are added.  Performance “enhancing” routines are inserted into the system such as automatic drive optimization, file content indexing, Virtual Assistant cross-referencing...  The list goes on and on, and all of these “enhancements” add a little lag to the performance of existing programs.

A delay of 3 to 4 seconds for a program to close and complete all these modern system requirements seems fairly normal to me.  Maybe you could write a simple exit routine to hide the program before closing it, and not suffer from such nerve-wrecking panic attacks?

IF _EXIT THEN _SCREENHIDE: SYSTEM

(Or _SCREENICON to just minimize it to the taskbar and let it close out properly there.)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: SYSTEM not close window immediately
« Reply #4 on: January 30, 2020, 07:19:23 am »
Thank you Neill

_SCREENHIDE can be a solution (the program stays running in the background for a few seconds but at least avoids the unnerving wait for the window to close, even if there's a risk of generating some conflict).

Remains the waiting time if you click on the X.
Maybe _EXIT would help but I did not understand how it works, even studying the example in the wiki.

The antivirus seems not to affect (avast!).

The operating system who knows that below that combines...  and I don't know how to tell him to close a program without thinking about it.

The panic.... when you do for hours of testing and testing we would like the execution to have the speed of a lightning. And when it's put online someone would say it doesn't work because it's too much to get out!

The "evolution" and "safety" of the operating system may actually be a cause of the delay but it is not entirely explained why the time is random: from 1 second to 7 or 8...

And then hopefully with windows 10 things are not worse...

Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: SYSTEM not close window immediately
« Reply #5 on: January 30, 2020, 11:18:41 am »
A little off the topic, but Avast sends information about the software you are using, the sites you visit and your activity on the Internet without the knowledge of the user to its servers, then Avast trades this data. Today there was an article about it. Try disabling this sh..  and test the behavior of the programs again.

Here is an article about Avast, which confirms what i wrote: (translate it from czech)  https://tech.ihned.cz/c1-66712290-avast-udajne-prodava-data-uzivatelu-svych-antiviru-za-miliony-dolaru-informace-o-tom-ale-schovava