diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-07-24 13:46:12 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-07-24 13:46:12 +0000 |
commit | 8b9b2ab39943070706515485cff6e23cbb564003 (patch) | |
tree | a7944312a411fee199bbdaa9ef3e47688ad08da4 /src/testbed/testbed_api_operations.c | |
parent | dd177ca10b140d68c79335c900b34a77f33cc98b (diff) | |
download | gnunet-8b9b2ab39943070706515485cff6e23cbb564003.tar.gz gnunet-8b9b2ab39943070706515485cff6e23cbb564003.zip |
fixed mem leaks with operations
Diffstat (limited to 'src/testbed/testbed_api_operations.c')
-rw-r--r-- | src/testbed/testbed_api_operations.c | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c index c98998bbf..31a46d85a 100644 --- a/src/testbed/testbed_api_operations.c +++ b/src/testbed/testbed_api_operations.c | |||
@@ -146,49 +146,12 @@ GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue, | |||
146 | * | 146 | * |
147 | * @param operation operation that finished | 147 | * @param operation operation that finished |
148 | */ | 148 | */ |
149 | static void | ||
150 | operation_release (struct GNUNET_TESTBED_Operation *operation) | ||
151 | { | ||
152 | // call operation->release, remove from queues | ||
153 | GNUNET_break (0); | ||
154 | } | ||
155 | |||
156 | |||
157 | /** | ||
158 | * Cancel a pending operation. Releases all resources | ||
159 | * of the operation and will ensure that no event | ||
160 | * is generated for the operation. Does NOT guarantee | ||
161 | * that the operation will be fully undone (or that | ||
162 | * nothing ever happened). | ||
163 | * | ||
164 | * @param operation operation to cancel | ||
165 | */ | ||
166 | void | ||
167 | GNUNET_TESTBED_operation_cancel (struct GNUNET_TESTBED_Operation *operation) | ||
168 | { | ||
169 | // test that operation had not yet generated an event | ||
170 | GNUNET_break (0); | ||
171 | operation_release (operation); | ||
172 | } | ||
173 | |||
174 | |||
175 | /** | ||
176 | * Signal that the information from an operation has been fully | ||
177 | * processed. This function MUST be called for each event | ||
178 | * of type 'operation_finished' to fully remove the operation | ||
179 | * from the operation queue. After calling this function, the | ||
180 | * 'op_result' becomes invalid (!). | ||
181 | * | ||
182 | * @param operation operation to signal completion for | ||
183 | */ | ||
184 | void | 149 | void |
185 | GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation) | 150 | operation_release_ (struct GNUNET_TESTBED_Operation *operation) |
186 | { | 151 | { |
187 | // test that operation was started and had generated an event | 152 | // call operation->release, remove from queues |
188 | GNUNET_break (0); | 153 | GNUNET_break (0); |
189 | operation_release (operation); | ||
190 | } | 154 | } |
191 | 155 | ||
192 | 156 | ||
193 | |||
194 | /* end of testbed_api_operations.c */ | 157 | /* end of testbed_api_operations.c */ |