#9448: segfault: django.contrib.gis.gdal.DataSource sub-objects not holding
references to parents
-------------------------------------------------+--------------------------
          Reporter:  [EMAIL PROTECTED]  |         Owner:  jbronn  
            Status:  assigned                    |     Milestone:  post-1.0
         Component:  GIS                         |       Version:  1.0     
        Resolution:                              |      Keywords:          
             Stage:  Accepted                    |     Has_patch:  1       
        Needs_docs:  0                           |   Needs_tests:  0       
Needs_better_patch:  0                           |  
-------------------------------------------------+--------------------------
Changes (by jbronn):

  * status:  new => assigned
  * has_patch:  0 => 1

Comment:

 Attached is a patch with tests that keeps a reference of the `DataSource`
 with each `Layer`; see if it works for you.  Moreover, there doesn't
 appear to be a problem with OGR features:

 {{{
 def get_shp_feature(shp_file):
     ds = DataSource(shp_file)
     lyr = ds[0]
     return lyr[0]

 feat = get_shp_feature('/path/to/foo.shp')
 print feat.geom
 print feat.fields
 }}}

 As the above code demonstrates, accessing a `Feature` still works even
 though the reference to the `DataSource` is no longer active.  Thus, the
 `DataSource`->`Layer` problem is fixed (with the patch) and
 `Layer`->`Feature` references appear fine without further patching.

 However, I still want to investigate more on ''why'' the `Feature`
 references are OK so I can be positive that its not required to keep a
 `DataSource` reference on each `Feature` as well.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9448#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to