mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-28 16:05:51 +00:00
fixed memory leak in custom wave
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/dev-1.0@296 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -79,7 +79,6 @@ CustomWave::CustomWave(int _id):
|
||||
this->value2 = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float));
|
||||
this->sample_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float));
|
||||
|
||||
|
||||
/* Start: Load custom wave parameters */
|
||||
|
||||
if ((param = Param::new_param_float("r", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->r, this->r_mesh, 1.0, 0.0, .5)) == NULL) {
|
||||
@ -93,11 +92,10 @@ CustomWave::CustomWave(int _id):
|
||||
abort();
|
||||
}
|
||||
|
||||
if ((param = Param::new_param_float("g", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->g, this->g_mesh, 1.0, 0.0, .5)) == NULL){
|
||||
if ((param = Param::new_param_float("g", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->g, this->g_mesh, 1.0, 0.0, .5)) == NULL) {
|
||||
delete(this);
|
||||
/// @bug make exception
|
||||
abort();
|
||||
|
||||
}
|
||||
|
||||
if (ParamUtils::insert(param, param_tree) < 0) {
|
||||
@ -117,37 +115,30 @@ CustomWave::CustomWave(int _id):
|
||||
delete(this);
|
||||
/// @bug make exception
|
||||
abort();
|
||||
|
||||
}
|
||||
|
||||
if ((param = Param::new_param_float("a", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->a, this->a_mesh, 1.0, 0.0, .5)) == NULL){
|
||||
delete(this);
|
||||
/// @bug make exception
|
||||
abort();
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (ParamUtils::insert(param, this->param_tree) < 0) {
|
||||
delete(this);
|
||||
/// @bug make exception
|
||||
abort();
|
||||
|
||||
}
|
||||
|
||||
if ((param = Param::new_param_float("x", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->x, this->x_mesh, 1.0, 0.0, .5)) == NULL) {
|
||||
delete(this);
|
||||
/// @bug make exception
|
||||
abort();
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (ParamUtils::insert(param, this->param_tree) < 0) {
|
||||
delete(this);
|
||||
/// @bug make exception
|
||||
abort();
|
||||
|
||||
}
|
||||
|
||||
if ((param = Param::new_param_float("y", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->y, this->y_mesh, 1.0, 0.0, .5)) == NULL) {
|
||||
@ -413,6 +404,8 @@ CustomWave::~CustomWave() {
|
||||
delete(pos->second);
|
||||
|
||||
|
||||
delete(param_tree);
|
||||
|
||||
free(r_mesh);
|
||||
free(g_mesh);
|
||||
free(b_mesh);
|
||||
|
||||
Reference in New Issue
Block a user