# HG changeset patch
# User Jason Grout <jason.grout@drake.edu>
# Date 1330766757 21600
# Node ID 6c04dc1555d3628a56975db1b1f78b3726793aec
# Parent fb6bb2d905a963f3486e446bb7a3b64d89f7653d
Fix several memory leaks in the cliquer interface.
diff --git a/sage/graphs/cliquer.pxd b/sage/graphs/cliquer.pxd
a
|
b
|
|
23 | 23 | |
24 | 24 | cdef extern from "cliquer/graph.h": |
25 | 25 | cdef graph_t * graph_new(int n) |
| 26 | cdef void graph_free(graph_t *g) |
26 | 27 | cdef void graph_print(graph_t *g) |
27 | | |
diff --git a/sage/graphs/cliquer.pyx b/sage/graphs/cliquer.pyx
a
|
b
|
|
24 | 24 | |
25 | 25 | |
26 | 26 | include "../ext/interrupt.pxi" |
| 27 | include "../ext/stdsage.pxi" |
27 | 28 | |
28 | 29 | |
29 | 30 | def max_clique(graph): |
… |
… |
|
72 | 73 | cdef int i |
73 | 74 | for i in range(size): |
74 | 75 | b.append(list[i]) |
| 76 | graph_free(g) |
| 77 | sage_free(list) |
75 | 78 | return list_composition(b,d_inv) |
76 | 79 | |
77 | 80 | |
… |
… |
|
120 | 123 | else: |
121 | 124 | b.append(list_composition(c,d_inv)) |
122 | 125 | c=[] |
| 126 | graph_free(g) |
| 127 | sage_free(list) |
123 | 128 | return b |
124 | 129 | |
125 | 130 | |
… |
… |
|
158 | 163 | sig_on() |
159 | 164 | c = sage_clique_number(g) |
160 | 165 | sig_off() |
| 166 | graph_free(g) |
161 | 167 | return c |
162 | 168 | |
163 | 169 | |