Show
Ignore:
Timestamp:
01/17/08 18:21:48 (4 years ago)
Author:
rkern
Message:

* BUG: fix a leak.
* Add some tests for the duplicate point handling contributed by "pv".

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/delaunay/scikits/delaunay/_delaunay.cpp

    r547 r745  
    127127    vdg.getNumbers(length, numtri); 
    128128 
     129    // Count the actual number of edges 
     130    i = 0; 
     131    vdg.resetEdgeListIter(); 
     132    while (vdg.getNextDelaunay(tri0, tri0x, tri0y, tri1, tri1x, tri1y, reg0, reg1)) 
     133        i++; 
     134    length = i; 
     135 
    129136    dim[0] = length; 
    130137    dim[1] = 2; 
     
    448455{ 
    449456    PyObject *pyx, *pyy, *pyz, *pycenters, *pynodes, *pyneighbors, *pyintx, *pyinty; 
    450     PyObject *x, *y, *z, *centers, *nodes, *neighbors, *intx, *inty, *intz; 
     457    PyObject *x = NULL, *y = NULL, *z = NULL, *centers = NULL, *nodes = NULL, 
     458        *neighbors = NULL, *intx = NULL, *inty = NULL, *intz; 
    451459    double defvalue; 
    452460    int size, npoints, ntriangles; 
     
    544552        (double*)PyArray_DATA(intz), defvalue); 
    545553 
    546     CLEANUP 
     554    Py_XDECREF(x); 
     555    Py_XDECREF(y); 
     556    Py_XDECREF(z); 
     557    Py_XDECREF(intx); 
     558    Py_XDECREF(inty); 
     559    Py_XDECREF(centers); 
     560    Py_XDECREF(nodes); 
     561    Py_XDECREF(neighbors); 
    547562    return intz; 
    548563}