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 memory leak when repeat open close camera #259 #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions libuvccamera/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

# This is just for mips, if you really needs MSA, un-comment and build with GCC.
# Note: Supporting GCC on NDK is already deprecated and GCC will be removed from NDK soon.
#NDK_TOOLCHAIN_VERSION := 4.9
NDK_TOOLCHAIN_VERSION := 4.9

APP_PLATFORM := android-14
APP_ABI := armeabi armeabi-v7a x86 mips
APP_ABI := armeabi-v7a
#x86 mips armeabi
#APP_OPTIM := debug
APP_OPTIM := release
4 changes: 4 additions & 0 deletions libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,11 @@ void UVCPreview::addCaptureFrame(uvc_frame_t *frame) {
}
captureQueu = frame;
pthread_cond_broadcast(&capture_sync);
} else {
// Add this can sovle native leak
recycle_frame(frame);
}

pthread_mutex_unlock(&capture_mutex);
}

Expand Down