[Gdal-dev] C# Osr.GetProjectionMethodParameterList Access Violation

Tamas Szekeres szekerest at gmail.com
Thu Jun 4 10:30:19 EDT 2009


Diaren,

Good point. Please file a ticket with this issue and I'll take care of
fixing that in SVN branch-1.6 and trunk.

Best regards,

Tamas



2009/6/4 Diaren <diarenwhan at yahoo.co.uk>

>
> Well I've learnt some swig and possibly solved the problem, can someone
> verify that this ok and maybe turn this into a proper patch or someting was
> against 1.6.0:
>
> typemaps_csharp.i
> +244:
>
> %typemap(argout) (char **staticstring)
> {
>  /* %typemap(argout) (char **staticstring) */
>  *$1 = SWIG_csharp_string_callback(*$1);
> }
>
> osr.i:
> -229:
> %rename (GetProjectionMethodParameterList) OPTGetParameterList;
> %apply (char **CSL) {(char **)};
> char **OPTGetParameterList( char *method, char **username );
> %clear (char **);
>
> %rename (GetProjectionMethodParamInfo) OPTGetParameterInfo;
> void OPTGetParameterInfo( char *method, char *param, char **usrname,
>                          char **type, double *defaultval );
>
> +229:
> %rename (GetProjectionMethodParameterList) OPTGetParameterList;
> %apply (char **CSL) {(char **)};
> %apply (char **staticstring) {(char **username)};
> char **OPTGetParameterList( char *method, char **username );
> %clear (char **);
> %clear (char **username);
>
> %rename (GetProjectionMethodParamInfo) OPTGetParameterInfo;
> %apply (char **staticstring) {(char **usrname), (char **type)};
> void OPTGetParameterInfo( char *method, char *param, char **usrname,
>                          char **type, double *defaultval );
> %clear (char **usrname);
> %clear (char **type);
>
>
> Diaren wrote:
> >
> > Problem is I don't know the first thing about how swig works... and If I
> > modify the OPTGetParameterList to use CPLStrdup or something, then that
> > will cause problems for other code which knows Username is a static
> string
> > and doesn't need freeing.
> >
> > So any swig experts that can modify the generated wrapper to not free
> > arg2? or is OPTGetParameterList supposed to allocate the string passed
> > back through Username?
> >
>
> --
> View this message in context:
> http://n2.nabble.com/C--Osr.GetProjectionMethodParameterList-Access-Violation-tp3024324p3024796.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090604/5e3b9c1d/attachment.html


More information about the gdal-dev mailing list