Opened on 06/15/2016 at 11:31:18 AM
Closed on 09/26/2017 at 06:48:59 AM
#4153 closed defect (fixed)
Replace all naked pointer returns to Java with wrapped versions
Reported by: | asmirnov | Assignee: | |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Libadblockplus-Android | Keywords: | |
Cc: | rjeschke, sergz | Blocked By: | |
Blocking: | Platform: | Android | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Due to memory allocation issue https://issues.adblockplus.org/ticket/4080#comment:6 all the raw pointers should be wrapped into shared_ptr.
Attachments (0)
Change History (2)
Note: See
TracTickets for help on using
tickets.
I would like to add into this issue to check that all intermediate C++ objects are deleted and marshal the object lifetimes. May be it should become a meta issue for smaller ones.
However I have noticed another usage, we are casting shared_ptr<T:JsValue>* to shared_ptr<JsValue> using reinterpret_cast, that's actually wrong.
Should not it be simply &value instead of new T(value)?
In general sometimes it's convenient to create an object outside and pass the pointer to it into a constructor. In that case the instance of newly created wrapper should take over the responsibility for deleting of the argument. However there should be an agreement for that approach or at least it should be documented. Currently nothing of it is visible.