Re: XSI 6 crashes, new bug ?

Date : Fri, 27 Apr 2007 13:55:26 +0100
To : XSI(at)Softimage.COM
From : "Alan Jones" <skyphyr(at)gmail.com>
Subject : Re: XSI 6 crashes, new bug ?
Hi Christopher,

You can use the Splish submission plugin as reference for this.

http://splish.svn.sourceforge.net/viewvc/splish/trunk/extplugins/xsi/

Cheers,

Alan.

On 4/27/07, Christopher Crouzet <christopher.crouzet(at)gmail.com> wrote:
Hello everyone,
I'm actually writing a custom property in C++, and I just found what looks
like a bug.
The property is intended to be temporary, so I'm calling the 'DeleteObj'
command within the 'siOnClosed' PPGEventContext to destroy the property when
the user has finished to interact with it.
By doing this, XSI 6 randomly crashes... sometimes after 3 tries, sometimes
after 20, but it always crashes.


Below is a code example to reproduce the problem by calling a few times the 'crashy' command.

// Start code.

XSIPLUGINCALLBACK CStatus crashy_Execute(CRef &in_ctxt)
{
    Context ctxt = in_ctxt;


Application app; Factory factory = app.GetFactory(); CRef refProp = factory.CreateObject(L"crashyProp");

    CValueArray inArgs(5);
    inArgs[0] = refProp;
    inArgs[3] = siLock;
    inArgs[4] = false;

    CValue outVal;

    app.ExecuteCommand(L"InspectObj", inArgs, outVal);


return CStatus::OK; }

XSIPLUGINCALLBACK CStatus crashyProp_PPGEvent(const CRef &in_ctxt)
{
    PPGEventContext ctxt = in_ctxt;
    PPGEventContext::PPGEvent ppgEvent = ctxt.GetEventID ();

    if (ppgEvent == PPGEventContext::siOnInit) {
        CustomProperty customProp = ctxt.GetSource();

        ctxt.PutAttribute(L"Close", true);
    }
    else if (ppgEvent == PPGEventContext::siOnClosed) {
        CustomProperty customProp = ctxt.GetSource();


CValueArray inArgs(1); inArgs[0] = customProp;

        CValue outVal;

        Application().ExecuteCommand(L"DeleteObj", inArgs,
outVal);
    }


return CStatus::OK; }

// End.



It perhaps looks strange to call the deletion of an object within the
callback of the object itself, but there is a similar code in the doc
(PluginRegistrar Class Reference).
And this code works fine in XSI 5.1, and crashe onnly with XSI 6.0 and XSI
6.01, so the code should be OK I think.

So, is it a new bug introduced since v6 ?
Does anyone have a workaround ?


Thanks ! Christopher.

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.