General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › ChooseTemplate issue
-
Polly Poon March 3, 2010 at 7:31 am
ChooseTemplate issue
March 3, 2010 at 7:31 amParticipants 0Replies 1Last Activity 12 years, 11 months agoHi,
I am using XMetaL 5.5 .
I have created a function to override the File > New operation with the following:
[code]
string newFilePath = null;
newFilePath = this.xMetalHelper.getApplication().Documents.ChooseTemplate();
[/code]where this.xMetalHelper.getApplication() would return an existing instance of XMetaL.Application.
I found that during runtime, if i click on the Cancel button on the ChooseTemplate dialog, XMetaL cannot be shut down properly, a remant instance would be left and I have to go to Task Manager to clear the process.
Is there a way to properly handle the ChooseTemplate process? How to exit gracefully if a user click the Cancel button on the ChooseTemplate dialog so there won't be memory leak?
Thanks.
Derek Read March 3, 2010 at 7:30 pm
Reply to: ChooseTemplate issue
March 3, 2010 at 7:30 pmI'm not sure I understand the need to instantiate XMetaL Author as a COM object here (unless this script is not living inside an MCR file, which seems likely as this code looks like C# or something).
I don't think this has anything to do with a particular API in the product. One reason it might not shut down properly is because there is an open reference to it somewhere.
Try to find an appropriate place to explicitly (on purpose) destroy the reference as soon as possible after you no longer need it and you should be OK.
If you think this is a bug in the product please submit a case to XMetaL Support including complete sample code to reproduce it. If possible, simplify the project to the point where it only contains just enough code to reproduce the issue as code that does something not directly related to the issue will confuse things.
-
AuthorPosts
- You must be logged in to reply to this topic.