projects
/
platform
/
upstream
/
libpinyin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b999e87
)
fixes memory leak in test_memory_chunk
author
Peng Wu
<alexepico@gmail.com>
Tue, 9 Oct 2012 05:22:08 +0000
(13:22 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Tue, 9 Oct 2012 05:22:08 +0000
(13:22 +0800)
tests/include/test_memory_chunk.cpp
patch
|
blob
|
history
diff --git
a/tests/include/test_memory_chunk.cpp
b/tests/include/test_memory_chunk.cpp
index
4920424
..
eefc357
100644
(file)
--- a/
tests/include/test_memory_chunk.cpp
+++ b/
tests/include/test_memory_chunk.cpp
@@
-58,14
+58,10
@@
int main(int argc, char * argv[]){
assert(chunk->get_content(sizeof(int), &tmp, sizeof(int)));
printf("%d\n", tmp);
- //clean up chunk
- delete chunk;
-
const char * filename = "/tmp/version";
const char * version = "0.2.0";
- //testing version check.
- chunk = new MemoryChunk;
+ /* testing version check. */
bool retval = chunk->load(filename);
if ( !retval ){
fprintf(stderr, "can't find chunk\n");
@@
-83,5
+79,7
@@
int main(int argc, char * argv[]){
printf("match\n");
}
+ delete chunk;
+
return 0;
}