Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / App Doesn't Close

Author
Message
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 24th Aug 2012 19:30
Hi there. I just had my Abacus App rejected by Intel again and the reason this time is because they spotted something I did not. Specifically, the program does not actually exit when you click the X button on the window, or when the program hits the end command. The program disappears for sure but if you open the task manager, it is still running. This causes problems when you try and launch the app for a second time.

I wondered if anyone else has come across this problem when compiling your programs for AppUp? Any advice would be greatly appreciated. I will post again if I manage to make any progress with this myself.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Aug 2012 20:19
Are you working in Tier 1 or Tier 2?

Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Aug 2012 20:30
I just realized that you must be in Tier 1, because there is no end command in Tier 2.

I just tested a simple app (same app, both tiers) and had the Task Manager opened.

In all cases, the app disappeared from the Processes list within a second or two, regardless of the method to close the app (x in corner or using the end command).

Cheers,
Ancient Lady
AGK Community Tester
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 24th Aug 2012 21:23
Thanks for the feedback Ancient Lady. Yes I'm using tier 1. How were you running your apps? Mine close fine when I run them from the IDE. It's the packaged version for Intel AppUp that doesn't close correctly. I'm using v1.6 because I can't upgrade until the update has Blackberry Tablet OS support. Anyhow thanks for your help with this.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Aug 2012 21:45
I run them by clicking on the executable created by the AppGameKit IDE, it will be in the same directory as your project.

I am using v1076, but that shouldn't be the issue.

I haven't done anything with AppUp, yet. So I don't know what your package looks like.

Cheers,
Ancient Lady
AGK Community Tester
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 24th Aug 2012 22:59
Ah yes, well like I say, the app produced by the IDE works just fine. However when you follow the instructions for deploying to AppUp, you compile from one of TGC's templates and just include the bytecode file. I've had a look but the main function definitely returns 0 so I don't know why it isn't closing... I'll keep investigating though Ludum Dare may cause something of a delay!

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Aug 2012 23:47
I just looked at the guide for Windows publishing of AppGameKit Tier 1.

It is quite confusing to me (and I got my Android and Xcode setups working).

I can't find where you include your own byte code file or where to put the media directory?

Anyway, the trick might be making sure that the app\interpreter code actually produces the same version as the IDE.

That is a question for one of the developers who would know if that directory was kept up to date.

Cheers,
Ancient Lady
AGK Community Tester
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 25th Aug 2012 00:07
Quote: "It is quite confusing to me"

And I, although I'm impressed you got Android sorted out. I'm still wrapping my brain around that one; although I'm finding it more complex because I was already developing for Android so I had some of the stuff (and some older versions of stuff) already installed. I think I only managed to get this one as far as I have because I'd already submitted a DBP app to AppUp.

Quote: "Anyway, the trick might be making sure that the app\interpreter code actually produces the same version as the IDE."

Interesting point. I suppose the template could be out of date or something.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Aug 2012 00:55
All of the Tier 2 templates are long out of date. This is an ongoing and known issue.

Paul did provide us with a working Android template (see the 'Your Products' TGC download page for that one).

And several of us of gotten a working MS Visual Studio Express 2010 template working. But I can't remember how we did it. If you need one, I can zip and upload mine, but you might have to fiddle with directory paths.

I hadn't worked with Android before, so figuring out how to make it work wasn't too bad. Of course, the main guide from the help pages isn't up to date and doesn't mention the need for the media directory under the assets one.

I hope you get the problem worked out. I finally got fed up with what appeared to be memory leak errors (and might not have been, it turns out) and converted my WIP Tier 1 to a Tier 2. And I am very happy I did (real classes! std::string, std::list!). My WIP is now 99.999% done, yeah!

Cheers,
Ancient Lady
AGK Community Tester
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 25th Aug 2012 01:15
Lucas, you can send a beta over to me for confirmation. Use my gmail email address.

Quote: "I'm using v1.6 because I can't upgrade until the update has Blackberry Tablet OS support. "

What you could try is downloading the .zip and running the latest AppGameKit from that (means you don't need to install). But I'm not sure if it will conflict or not.

Quote: "several of us of gotten a working MS Visual Studio Express 2010 template working. But I can't remember how we did it. "

I made videos for this very reason.

mr_d
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 25th Aug 2012 05:22
Hi Lucas,
You didn't mention whether your app was a free or paid one. If it's free, because of the new rules for AppUp for free apps, you would not need to build your own interpreter from the templates and could just use the normal one that the IDE builds. If your app is paid, then that's another matter Cheers.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 25th Aug 2012 09:30 Edited at: 25th Aug 2012 09:35
Quote: "All of the Tier 2 templates are long out of date. This is an ongoing and known issue."

Ah well in that case, that may be the issue.

Quote: "If you need one, I can zip and upload mine, but you might have to fiddle with directory paths."

Thanks, that would be handy. I'd like to take a look although I may not have any time over the weekend. If possible, could you send it to lrhedge at tezsoft dot co dot uk?

Quote: "I finally got fed up with what appeared to be memory leak errors (and might not have been, it turns out) and converted my WIP Tier 1 to a Tier 2."

I like object orientation too but my concern with this is how portable it will be. We know that the web platform will use Java and Javascript so although up to now, you should just be able to copy and paist your C++ code between platforms, future platforms may not be supported in this way.

Quote: "Lucas, you can send a beta over to me for confirmation."

Sure, I've done that now. Thanks for taking a look for me .
EDIT: Can't actually send it over for a few minutes because I've had to upload a new binary. Will send it over ASAP though.

Quote: "You didn't mention whether your app was a free or paid one. If it's free, because of the new rules for AppUp for free apps, you would not need to build your own interpreter from the templates"

Really? Nice! Yes it is a free app. I'll have to look in to that then. Could be a nice easy solution although it would still be good to check that I can deploy to AppUp through the template because I do plan to try and published paid apps there in the future. Thanks for the hint though .

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Aug 2012 18:48
Just to be clear, the templates I'm talking about are the ones for basic Tier 2 apps in the IDE/templates directory, not anything in the IDE/apps directory.

I don't know what needs to be done in the templates in the IDE/apps directory, if anything. Those I would expect to be up to date.

As for portability, I wasn't worried about a future web platform for AGK.

Cheers,
Ancient Lady
AGK Community Tester
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 27th Aug 2012 09:30
Quote: "Just to be clear, the templates I'm talking about are the ones for basic Tier 2 apps in the IDE/templates directory, not anything in the IDE/apps directory."

Oh right, sorry, I was getting a bit confused there. Yes it is the templates from the apps directory that I think I've been using to package the app. Hopefully now LD is over I can have another look at this and see if I can track down what is causing the problem. Thanks again for your suggestions.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 27th Aug 2012 19:04
OK well I've done some more experiments and what I found was that when I commended out most of the stuff in the int APIENTRY _tWinMain function, the program terminated with the function call App.End() but when everything was uncommented, it returned from the App.End() function call and ran on to hit the return 0 statement. Now what I notice is that when App.End() terminates the program itself, the process immediately greatly reduces its memory usage and then ends after a few seconds. However when it runs on to return 0 instead, the memory usage is unchanged and the process just keeps running. The only difference is that all visible signs of the app (the window and the icon on the taskbar) disappear, as if the app had closed. Now there are probably a million reasons I shouldn't have done this (please tell me if there are) but my basic brute force solution to this is to add an exit(0); call after the App.End(); and before the return 0.

So basically, this:


becomes this:


I'll try re-submitting the app and see what happens. Hope this helps anyone else with the same issue and do post back if you find any problems with this.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Aug 2012 19:18
I look forward to seeing if that works. Good luck!

Cheers,
Ancient Lady
AGK Community Tester
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 29th Aug 2012 21:11
Hi again. Just to let you know that Intel approved my latest submission which included the fix I mentioned above so I guess that works then!

Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 7th Sep 2012 18:54
That might create memory leaks, because it seems like the App.End() function is hitting an error and isn't shutting down AppGameKit like it should be.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 9th Sep 2012 00:28
Quote: "That might create memory leaks, because it seems like the App.End() function is hitting an error and isn't shutting down AppGameKit like it should be."

Interesting point there. That said, surely as the app is closing down, the OS will deallocate all the memory used by the process, right? Not sure what I can do about it really if the App.End() function is hitting an error. It obviously doesn't throw a visible error so do you have any idea what kind of thing it might be? It certainly isn't causing a crash.

Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 9th Sep 2012 00:38
Quote: " the OS will deallocate all the memory used by the process, right?"

You would hope so, but honestly I wouldn't count on it. To make sure that the app isn't leaking memory, you could try using the Visual Studio utility for detecting memory leaks( more information ).

a1seo
11
Years of Service
User Offline
Joined: 20th Oct 2012
Location:
Posted: 20th Oct 2012 12:32
I mentioned above so I guess that works then.

thanks
packersm

bde at http://www.packersmoversdirectory.net/

Login to post a reply

Server time is: 2024-04-25 06:57:24
Your offset time is: 2024-04-25 06:57:24