=bpy beztriple: finally got the mem. management right with the help of khughes.
This commit is contained in:
		| @@ -404,6 +404,7 @@ PyObject *BezTriple_CreatePyObject( BezTriple * bzt ) | |||||||
| 					      "couldn't create BPy_BezTriple object" ); | 					      "couldn't create BPy_BezTriple object" ); | ||||||
|  |  | ||||||
| 	pybeztriple->beztriple = bzt; | 	pybeztriple->beztriple = bzt; | ||||||
|  | 	pybeztriple->own_memory = 0; | ||||||
|  |  | ||||||
| 	return ( PyObject * ) pybeztriple; | 	return ( PyObject * ) pybeztriple; | ||||||
| } | } | ||||||
| @@ -496,9 +497,7 @@ PyObject *newBezTriple( PyObject *args) | |||||||
| 	pybez->beztriple = MEM_callocN( sizeof( BezTriple ), "new bpytriple"); | 	pybez->beztriple = MEM_callocN( sizeof( BezTriple ), "new bpytriple"); | ||||||
| 	/* check malloc */ | 	/* check malloc */ | ||||||
|  |  | ||||||
| 	pybez->own_memory = 0;  /* we own it. must free later */ | 	pybez->own_memory = 1;  /* we own it. must free later */ | ||||||
| 	/* set to 0 for creating to work. how should freeing be done? */ |  | ||||||
|  |  | ||||||
| 	 | 	 | ||||||
| 	switch( length ) { | 	switch( length ) { | ||||||
| 	case 9: { | 	case 9: { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user