SWIG mapscript critical problems!!!
Tamas Szekeres
szekerest at GMAIL.COM
Sun Jun 18 14:34:47 EDT 2006
Hi,
I can see that the java and C# are something similar in these cases.
The reason that the workaround mentioned goes is that when destroying the
object the current implementation prevents from destroying the swigCPtr
referenced memory if the object belongs to a parent object. For example in
class.i we have:
~classObj()
{
if (!self->layer)
{
freeclass(self);
free(self);
}
}
However the correct solution is to notify swig so as to set the internal
swigCMemOwn to false if the object was constucted with a given parent
object.
For example In C# we can acieve this as:
%typemap(csconstruct, excode=SWIGEXCODE) classObj(layerObj layer) %{:
this($imcall, true) {
if (layer != null) this.swigCMemOwn = false;$excode
}
%}
And we can do the same for layerObj and styleObj as well.
Best Regards,
Tamas
_____
From: Benedikt Rothe [mailto:b.rothe at hydrotec.de] On Behalf Of
umn-ms at hydrotec.de
Sent: Sunday, June 18, 2006 2:37 PM
To: Tamas Szekeres; MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-DEV] SWIG mapscript critical problems!!!
Same problem in Java-Mapscript:
http://article.gmane.org/gmane.comp.gis.mapserver.user/11678
btw: Workaround - no solution! - ist to call delete() directly:
http://article.gmane.org/gmane.comp.gis.mapserver.user/11536
Benedikt
UMN MapServer Developers List <MAPSERVER-DEV at LISTS.UMN.EDU> schrieb am
16.06.2006 18:09:44:
> Developers,
>
> Along with the recent postings on the user's list some of the folks
> are complaining about funky
> segfaults, memory reference exceptions when using some of the mapscript
objects.
>
> I have found the following problems and would like to know if these
> issues apply to the other languages or not.
>
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1803
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1743
>
> Best Regards,
>
> Tamas
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 2006.06.16.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 2006.06.16.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20060618/d715d8b8/attachment.html
More information about the mapserver-dev
mailing list