Window disposed message

Posts   
 
    
yowl
User
Posts: 266
Joined: 11-Feb-2008
# Posted on: 27-Jan-2015 15:16:54   

Using the designer inside VS. (December 4th, 2014). If you start the generate code action, then close the tab before it finishes you get a

"Cannot access disposed object. Object name 'MainWindow'.

message.

Seems liks the generate code completes fine though.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 27-Jan-2015 17:19:56   

Ok. We'll see whether we can prevent the tab from closing while the code generation process runs. I have no idea how though, so it might not work.... VS.NET integration... never a dull moment disappointed

Frans Bouma | Lead developer LLBLGen Pro
yowl
User
Posts: 266
Joined: 11-Feb-2008
# Posted on: 27-Jan-2015 18:03:27   

Or let it close, if it completes in the background then that's fine with me and in fact I'd prefer that.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 28-Jan-2015 16:41:15   

I think it crashes in some post codegen update cycle on the main window, which of course is bogus. I'll see if I can reproduce it and get a stacktrace. In the normal designer one can't get this as the code generation config dialog is modal and the main window can't be closed.

(edit). Of course... vs.net doesn't give you a stack trace.. why would it! disappointed

(edit) the editor pane is killed while the code generation still runs. So it's not really useful to provide a proper clean up, it won't work. The close has to be prevented somehow. Will have to investigate how to do that (as the vs.net tab is simply closed, no matter what)

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 28-Jan-2015 17:06:10   

Isn't this the same as when the user kills the designer process when it's running standalone? Closing the tab in vs.net is equal to closing the designer. If a code generation process is running, it's killed mid-process. I'm not sure how to fix this, as the only way to block it it seems is by locking the tab but how that's done is beyond me (docs are .... scarce for extending vs.net) I will look further, but it occurs to me that the meaning of closing the tab mid-generation is no other than 'kill process' as it's wrong to assume the process will complete with what's it's doing if it's no longer there.

the best way is to keep the tab open of course, so vs.net shouldn't allow to let the user close anything, but at the moment I don't see how that's accomplished.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 29-Jan-2015 17:41:32   

It's not possible to prevent the tab from being closed, (or no-one on the planet knows about it), so that's out the window. I've added some if checks to prevent the exception, but it also will prevent the projects being updated in the solution (the generated projects) and the log being shown. But I think that's fair, you killed the designer prematurely, so if it has to do something after the process it's currently doing, it's of course not able to do that.

It's not like in word where you press 'print' and you can close word and the doc still gets printed: the code-gen process IS the designer simple_smile

Frans Bouma | Lead developer LLBLGen Pro