B4J Question B4J app crash

Claudio Oliveira

Active Member
Licensed User
Longtime User
Hey guys!
I'm facing a quite weird problem with a B4J app.
Looks like it happens when I use FileChooser.ShowOpenMultiple(MainForm).
Whenever I hit "Cancel" on the file chooser dialog, application crashes immediately.
In debug mode, B4J IDE stays running as if the app was still open even though it's not.
Sometimes it takes more than one "cancel" click, but it always happens.
It happens also in release mode, in which case the UI closes and leaves Java SE binary running and I have to finish in task manager.
Find attached a test project to reproduce the error
It's a simple project that opens a main form with a button. Clicking that button, it opens the file open dialog. Select one or more files and click "Open". The selected filenames are written to log.
Click "Cancel", and the app closes immediately with no information whatsoever. No error, no warning, no nothing. It just crashes.
I'd appreciate it someone would shed a light on this rather strange behaviour.
Thanks!

I'm running Windows 10, B4J 10.0, JRE 8, JDK 11
 

Attachments

  • teste.zip
    2.1 KB · Views: 120

Daestrum

Expert
Licensed User
Longtime User
It seems to be doing exactly what it's meant to.
If you click cancel, the list is not initialized, so the if branch is taken ie return.

If you want the app to end if no files are selected then change the Return to ExitApplication.
 
Upvote 0

Claudio Oliveira

Active Member
Licensed User
Longtime User
It seems to be doing exactly what it's meant to.
If you click cancel, the list is not initialized, so the if branch is taken ie return.

If you want the app to end if no files are selected then change the Return to ExitApplication.
Thank you @Daestrum.
That's exactly the point: I do not want the app to end, but it's ending nonetheless.
And it gets worse.
Sometimes this happens. Sometimes not. And sometimes it happens in the third or fourth time I open de File Chooser and click Cancel.
Obviously there must be a reasonable cause for this, but I just can't see one...

?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i tried your project from #1.
- Clicked the button and cancel or select some files.
- Even after 20 time cancel it does not crash here
 
Upvote 0

Claudio Oliveira

Active Member
Licensed User
Longtime User
i tried your project from #1.
- Clicked the button and cancel or select some files.
- Even after 20 time cancel it does not crash here
Thank you so much @DonManfred!
I tried it on my wife's computer (which is IDENTICAL to mine) and it didn't crash, not a single time.
I'm starting to believe that there's something to do with my development environment. B4X, Java (JDK, JRE), etc...
Based on this , I've decided to:
- Do a computer backup;
- Uninstall everything related to B4X and Java;
- Clean up the Windows registry;
- Reinstall everything.
Hopefully this will do ok.
I'll be back with results.
Thanks again, Don! ?
 
Upvote 0

Claudio Oliveira

Active Member
Licensed User
Longtime User
...
I'll be back with results.
...
Well, I'm back and unfortunately that didn't work as well...

I really don't know what is causing this crazy behaviour that happens only in my computer.
It's frustrating and annoying, to say the least.
It's obviuosly something related to operating system configuration and/or system files. I don't have available time and will enough to investigate this any longer.
For now I'm migrating my dev environment to a notebook that I seldom use. It's Windows 10 64 bits, 1Tb HD, up and running and properly updated.
If and when I format my HD, which I do from time to time (it's Windows after all, ain't it?), I'll try to move my dev environment back to my main computer.
Thank you guys.
 
Upvote 0
Top