mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-08 03:36:44 +00:00
Avoid memory leak
According to the best practices for boost, the shared_ptr constructor should not be called inside a function call (return in this case). Ref: http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/shared_ptr.htm Signed-off-by: Javier Arribas <jarribas@cttc.es>
This commit is contained in:
parent
20121dcc73
commit
7fc58001ec
@ -49,7 +49,8 @@ boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue)
|
||||
{
|
||||
return boost::shared_ptr<gnss_sdr_valve> (new gnss_sdr_valve (sizeof_stream_item, nitems, queue));
|
||||
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue));
|
||||
return valve_;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user