[pyxpcom] int array in pyxpcom
by Jiangweiran other posts by this author
Dec 5 2007 1:56AM messages near this date
view in the new Beta List Site
Re: [pyxpcom] xulrunner trunk, build error in PyIInterfaceInfo.cpp
|
Re: [pyxpcom] What changed in PyXPCOM component registration in 1.9?
Hello all:
I have a idl which defines following function:
//get the user font info
void getUserFontInfo(out PRUint32 defaultFontIndex, out PRUint32 fontCount, out PRUint32
arrayLen, [array,size_is(array Len)] out PRInt16 userFonts);
in this function,the userFonts is corresponding to one int array,I return the array's pointe
r to outside throught pyxpcom,and the python can get all the array element(very cool),but af
ter I del the variable referring the userFonts, it seems the inside c++ int array is also be
ing freed,which leads to the core dumped.is this a design problem for idl?
I now do a memcpy in getUserFontInfo implementation(C++),and return the copied array to pyth
on,now everyone is happy,is this ok?
thanks all.
|