[GRASS-dev] Re: [GRASS GIS] #837: Memory leaks in r.example

GRASS GIS trac at osgeo.org
Mon Dec 21 01:04:44 EST 2009


#837: Memory leaks in r.example
----------------------+-----------------------------------------------------
  Reporter:  sprice   |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect   |      Status:  reopened                 
  Priority:  normal   |   Milestone:  6.4.0                    
 Component:  default  |     Version:  svn-releasebranch64      
Resolution:           |    Keywords:                           
  Platform:  MacOSX   |         Cpu:  OSX/Intel                
----------------------+-----------------------------------------------------
Comment (by glynn):

 Replying to [comment:4 glynn]:

 > 3. Make open_null_read free the return value. I '''think''' that it will
 always be unique in this case, as a mapset is always being passed in.

 Incidentally, this is exactly what it used to do from at least 5.3 (I
 don't have an older version) until r30300 (Feb 2008). I can't find any
 indication that this was made in response to a bug report. So in spite of
 this being a hack, I'm inclined to take this route.

 However: that doesn't solve the issue with G_open_old_misc(). That also
 used to free the returned mapset, in spite of this being unsafe; this was
 fixed in r29711. In theory, it would be possible to fix that by deducing
 whether G_find_file2() is returning a unique allocation or a shared
 pointer, but that's unspeakably ugly.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/837#comment:7>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list