diff options
author | hyunho <hhstark.kang@samsung.com> | 2018-11-13 17:29:59 +0900 |
---|---|---|
committer | hyunho <hhstark.kang@samsung.com> | 2018-11-13 17:38:23 +0900 |
commit | e3c30b9fa2b2d53b33bca888edf62faa21118098 (patch) | |
tree | 9677d0723d1a8466ea07960c1ac1e95d1ef04090 /screen_connector_remote_surface_evas | |
parent | 2906d4475e20c754a0c372904c20f9b959354df2 (diff) | |
download | screen-connector-e3c30b9fa2b2d53b33bca888edf62faa21118098.tar.gz screen-connector-e3c30b9fa2b2d53b33bca888edf62faa21118098.tar.bz2 screen-connector-e3c30b9fa2b2d53b33bca888edf62faa21118098.zip |
Check buffer duplication
If we do not check it, new buffer can be destroyed and empty pointer is remained
in viewer side and could cause null tbm buffer issue.
Change-Id: Ib9ffc53d02ec4f181f0f4117bc35fc37317afc77
Signed-off-by: hyunho <hhstark.kang@samsung.com>
Diffstat (limited to 'screen_connector_remote_surface_evas')
-rw-r--r-- | screen_connector_remote_surface_evas/image.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/screen_connector_remote_surface_evas/image.cc b/screen_connector_remote_surface_evas/image.cc index df4558a..d38320f 100644 --- a/screen_connector_remote_surface_evas/image.cc +++ b/screen_connector_remote_surface_evas/image.cc @@ -14,8 +14,15 @@ * limitations under the License. */ +#include <dlog.h> + #include "screen_connector_remote_surface_evas/image_internal.h" +#ifdef LOG_TAG +#undef LOG_TAG +#endif + +#define LOG_TAG "SC_REMOTE_SURFACE" #define SC_TOOLKIT_HANDLE_TAG "SC_TOOLKIT_HANDLE_TAG" namespace screen_connector { @@ -176,6 +183,12 @@ void Image::Update(std::shared_ptr<WlBuffer> tbm) { tbm_surface_h tbmSurface; Evas_Native_Surface ns; + /* if prev buffer is equal to current buffer, do not cleanup tizen remote surface resources */ + if (prev_buf_.get() != nullptr && tbm->GetRaw() == prev_buf_->GetRaw()) { + prev_buf_->SetIsOwner(false); + LOGW("Same buffer do not destroy buffer(%p)", tbm->GetRaw()); + } + prev_buf_ = std::move(tbm); /* get tbm surface from buffer */ tbmSurface = (tbm_surface_h)wl_buffer_get_user_data(prev_buf_->GetRaw()); |