Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(🤖): don't try to resize if the surface has been deleted #2467

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ void RNSkOpenGLCanvasProvider::surfaceSizeChanged(int width, int height) {
return;
}

if (_surfaceHolder == nullptr) {
// No surface holder, nothing to do
return;
}

// Recreate RenderContext surface based on size change???
_surfaceHolder->resize(width, height);

Expand Down
2 changes: 1 addition & 1 deletion package/cpp/rnskia/RNSkJsiViewApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ class RNSkJsiViewApi : public RNJsi::JsiHostObject,
* @return The callback info object for the requested view
*/
RNSkViewInfo *getEnsuredViewInfo(size_t nativeId) {
std::lock_guard<std::mutex> lock(_mutex);
if (_viewInfos.count(nativeId) == 0) {
RNSkViewInfo info;
std::lock_guard<std::mutex> lock(_mutex);
_viewInfos.emplace(nativeId, info);
}
return &_viewInfos.at(nativeId);
Expand Down
Loading