We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d683965 commit ac6da83Copy full SHA for ac6da83
src/mpb_interface.jl
@@ -19,8 +19,12 @@ numvar(m::SCIPMathProgModel) = _getNumVars(m)
19
numconstr(m::SCIPMathProgModel) = _getNumConss(m)
20
21
function freemodel!(m::SCIPMathProgModel)
22
- # call finalizer directly
23
- freescip(m.inner)
+ if m.inner.ptr_model != C_NULL
+ # call finalizer directly
24
+ freescip(m.inner)
25
+ else
26
+ Base.warn_once("Tried to free already freed model, ignoring.")
27
+ end
28
end
29
30
# TODO: mapping for :SemiCont, :SemiInt
src/types.jl
@@ -25,8 +25,6 @@ function freescip(m::SCIPModel)
if m.ptr_model != C_NULL
_freeModel(m)
m.ptr_model = C_NULL
- else
- Base.warn_once("Tried to free already freed model, ignoring.")
31
32
0 commit comments