Changeset 4917
- Timestamp:
- Jan 9, 2008, 2:06:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/mesh_engine/mesh_engine_c_layer.c
r4916 r4917 271 271 (char*) out.pointlist); 272 272 273 /* 274 (double*) genpointlist -> data = out.pointlist; 275 ((double*) genpointlist -> data) = out.pointlist; 276 ( genpointlist -> data) = (double*) out.pointlist; 277 genpointlist -> data = (double) out.pointlist; 278 279 */ 280 273 281 274 /* Add point marker list */ 282 275 dimensions[0] = out.numberofpoints; … … 336 329 } 337 330 338 /* Add triangle neighbor list */ 339 /*if (out.neighborlist != NULL) { 340 listsize = out.numberoftriangles; 341 holderlist = PyList_New(listsize); 342 for(i=0; i<listsize;i++){ 343 PyObject *mlist = Py_BuildValue((char *)"(i,i,i)", 344 out.neighborlist[i*3 ], 345 out.neighborlist [i*3+1], 346 out.neighborlist [i*3+2]); 347 PyList_SetItem(holderlist,i, mlist); 348 } 349 ii=PyString_FromString("generatedtriangleneighborlist"); 350 PyDict_SetItem(holder, ii, holderlist); 351 Py_DECREF(ii); Py_DECREF(holderlist); 352 } 353 */ 354 355 356 /* R = Py_BuildValue((char *)"O", holder); */ 331 357 332 R = Py_BuildValue((char *)"OOOOOOOO" 358 333 ,PyArray_Return(gentrianglelist) … … 365 340 ,PyArray_Return(genneighborlist) 366 341 ); 367 /*Py_DECREF(holder);* This fixed a memory problem ticket#189 */ 342 368 343 Py_DECREF(gentrianglelist); 369 344 Py_DECREF(genpointlist); … … 376 351 377 352 378 /* Free in/out structure memory */ 379 /* OUT 380 353 /* These memory blocks are passed into Numeric arrays 354 so don't free them */ 355 /* 356 if(!out.trianglelist){ 357 free(out.trianglelist); out.trianglelist=NULL; 358 359 381 360 if(!out.pointlist){ 382 361 free(out.pointlist); out.pointlist=NULL; 383 } 362 } 363 384 364 if(!out.pointmarkerlist){ 385 365 free(out.pointmarkerlist); out.pointmarkerlist=NULL; 386 366 } 367 387 368 if(!out.pointattributelist){ 388 369 free(out.pointattributelist); out.pointattributelist=NULL; 389 370 } 390 if(!in.pointattributelist){ 391 free(out.pointattributelist); out.pointattributelist=NULL; 392 } 393 if(!out.trianglelist){ 394 free(out.trianglelist); out.trianglelist=NULL; 395 } 371 396 372 if(!out.triangleattributelist){ 397 373 free(out.triangleattributelist); out.triangleattributelist=NULL; 398 374 } 375 if(!out.segmentlist){ 376 free(out.segmentlist); out.segmentlist =NULL; 377 } 378 if(!out.segmentmarkerlist){ 379 free(out.segmentmarkerlist); out.segmentmarkerlist =NULL; 380 } 381 if(!out.neighborlist){ 382 free(out.neighborlist); out.neighborlist=NULL; 383 } 384 */ 385 386 387 388 /* Free in/out structure memory */ 389 399 390 if(!out.trianglearealist){ 400 391 free(out.trianglearealist); out.trianglearealist=NULL; 401 392 } 402 if(!out.neighborlist){403 free(out.neighborlist); out.neighborlist=NULL;404 }405 if(!out.segmentlist){406 free(out.segmentlist); out.segmentlist =NULL;407 }408 if(!out.segmentmarkerlist){409 free(out.segmentmarkerlist); out.segmentmarkerlist =NULL;410 }411 393 if(!out.edgelist){ 412 394 free(out.edgelist); out.edgelist=NULL; … … 421 403 free(out.regionlist); out.regionlist=NULL; 422 404 } 423 */424 405 return R; 425 406 }
Note: See TracChangeset
for help on using the changeset viewer.