Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
1dd017e9
Commit
1dd017e9
authored
Sep 18, 2013
by
hbristow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a memory leak in mxarray
parent
eb3a8320
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
mxarray.hpp
modules/matlab/include/opencv2/matlab/mxarray.hpp
+13
-12
No files found.
modules/matlab/include/opencv2/matlab/mxarray.hpp
View file @
1dd017e9
...
...
@@ -113,7 +113,7 @@ template<typename _Tp = DefaultTraits> class Traits {
public
:
static
const
mxClassID
ScalarType
=
mxUNKNOWN_CLASS
;
static
const
mxComplexity
Complex
=
mxCOMPLEX
;
static
const
mxComplexity
Real
=
mx
COMPLEX
;
static
const
mxComplexity
Real
=
mx
REAL
;
static
std
::
string
ToString
()
{
return
"Unknown/Unsupported"
;
}
};
// bool
...
...
@@ -248,6 +248,16 @@ public:
*/
MxArray
()
:
ptr_
(
mxCreateDoubleMatrix
(
0
,
0
,
matlab
::
Traits
<>::
Real
)),
owns_
(
true
)
{}
/*!
* @brief destructor
*
* The destructor deallocates any data allocated by mxCreate* methods only
* if the object is owned
*/
virtual
~
MxArray
()
{
dealloc
();
}
/*!
* @brief inheriting constructor
*
...
...
@@ -267,7 +277,8 @@ public:
*
* This constructor explicitly creates an MxArray of the given size and type.
*/
MxArray
(
size_t
m
,
size_t
n
,
size_t
k
,
mxClassID
id
,
mxComplexity
com
=
matlab
::
Traits
<>::
Real
)
:
owns_
(
true
)
{
MxArray
(
size_t
m
,
size_t
n
,
size_t
k
,
mxClassID
id
,
mxComplexity
com
=
matlab
::
Traits
<>::
Real
)
:
ptr_
(
NULL
),
owns_
(
true
)
{
mwSize
dims
[]
=
{
static_cast
<
mwSize
>
(
m
),
static_cast
<
mwSize
>
(
n
),
static_cast
<
mwSize
>
(
k
)
};
ptr_
=
mxCreateNumericArray
(
3
,
dims
,
id
,
com
);
}
...
...
@@ -318,16 +329,6 @@ public:
return
s
;
}
/*!
* @brief destructor
*
* The destructor deallocates any data allocated by mxCreate* methods only
* if the object is owned
*/
virtual
~
MxArray
()
{
dealloc
();
}
/*!
* @brief copy constructor
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment