[Qgis-developer] Object owner design in QgsGraphBuilder

Kuhn Matthias, Vermessung Matthias.Kuhn at Stadt-Uster.ch
Mon Aug 27 01:53:09 PDT 2012


Hi

> -----Original Message-----
> From: Tim Sutton [mailto:lists at linfiniti.com] 
> Sent: Friday, August 24, 2012 7:11 PM
> To: Matthias Kuhn
> Cc: Kuhn Matthias, Vermessung; qgis-developer ML
> Subject: Re: [Qgis-developer] Object owner design in QgsGraphBuilder
> 
> Hi
> 
> On Fri, Aug 24, 2012 at 9:32 AM, Matthias Kuhn 
> <matthias.kuhn at gmx.ch> wrote:
> > Just figured out that the sip option /Factory/ tells python that it 
> > takes ownership of this object. So there won't be any 
> memory loss. I'd 
> > still say this should be changed and if not at least stated 
> in the API 
> > so anybody using this in C++ will be aware of this without 
> reading the 
> > code.
> >
> 
> Patches to the code that document things better will be welome.
> 
> Regards
> 
> Tim
> 

Sure, additional documentation is always a nice thing to have :)

I have commited some updates to this library. The code-changes I made will add some functionality without breaking any existing plugin and do some additional sanity checks to avoid misusage of the QgsGraphBuilder.

Documentation blocks added:
https://github.com/matthias-kuhn/Quantum-GIS/commit/6cae97155901525e93cbdf31af7ac7ad7c103805

Add asserts to protect from accessing null-pointers:
https://github.com/matthias-kuhn/Quantum-GIS/commit/0b34bd76658688509aef988f37dd8aa755722dbc

Return ids of created vertexes and arcs
https://github.com/matthias-kuhn/Quantum-GIS/commit/3d4f2251c759bcc1bce91aa1424b79a01c0c22b8

Please review and merge as you like. Any feedback is welcome.

Regards


More information about the Qgis-developer mailing list