summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-07-13 10:41:31 +0200
committerben <benjaminfranzke@googlemail.com>2010-07-13 10:41:31 +0200
commit148d8bdded18b7788db20a4ec455fe18f73947f2 (patch)
treeebebae836f9837644e117461a0545b3487d5bded /src
parentb071118b59b117652d7a45c4104a78d65995329e (diff)
downloadpa-sink-ctl-148d8bdded18b7788db20a4ec455fe18f73947f2.tar.gz
pa-sink-ctl-148d8bdded18b7788db20a4ec455fe18f73947f2.tar.bz2
pa-sink-ctl-148d8bdded18b7788db20a4ec455fe18f73947f2.zip
stop setting local pntrs NULL when globals needed (tmp commented out)
all *_clear functions get a pointer that should be freed by that function. after freeing they are set to NULL, but thats only in local scope, i.e: the global pointer stays NOT NULL void sink_list_clear(sink_info** sink_list, ...) { [..] free(sink_list); sink_list = NULL; } so if it is really intended, all clear functions need to be changed to: void sink_list_clear(sink_info ***sink_list,...) { [..] free(*sink_list); *sink_list = NULL; }
Diffstat (limited to 'src')
-rw-r--r--src/sink.c9
-rw-r--r--src/sink_input.c4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/sink.c b/src/sink.c
index 3622f74..01f0e04 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -35,7 +35,7 @@ void sink_clear(sink_info* sink) {
sink_input_list_clear(sink->input_list, &sink->input_max);
free(sink);
- sink = NULL;
+ //sink = NULL;
}
void sink_check(sink_info** sink) {
@@ -97,5 +97,10 @@ void sink_list_clear(sink_info** sink_list, uint32_t* max, uint32_t* counter) {
(*counter) = 0;
free(sink_list);
- sink_list = NULL;
+ // sink_list = NULL;
+
+ /* TODO: for all *_clear:
+ * setting local parameter to NULL doesnt do want is wanted
+ * pointer to sink_list would be needed here...
+ */
}
diff --git a/src/sink_input.c b/src/sink_input.c
index 5679813..8b3eab8 100644
--- a/src/sink_input.c
+++ b/src/sink_input.c
@@ -24,7 +24,7 @@ void sink_input_clear(sink_input_info* sink_input) {
free(sink_input->pid);
free(sink_input);
- sink_input = NULL;
+ // sink_input = NULL;
}
sink_input_info** sink_input_list_init(int max) {
@@ -55,7 +55,7 @@ void sink_input_list_clear(sink_input_info** sink_input_list, int *max) {
(*max) = 0;
free(sink_input_list);
- sink_input_list = NULL;
+ // sink_input_list = NULL;
}
void sink_input_check(sink_input_info** sink_input) {