Skip to content

Commit bc06ffb

Browse files
committed
THETA のプレビュー表示中にサンプルアプリが強制終了する問題を修正。GLスレッド上でテクスチャを破棄するように修正。
1 parent bb532a5 commit bc06ffb

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/core

dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/core/SphericalViewRenderer.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void requestToUpdateTexture() {
200200
mTextureUpdate = true;
201201
}
202202

203-
private void draw(final Camera camera) {
203+
private synchronized void draw(final Camera camera) {
204204
Matrix.setIdentityM(mModelMatrix, 0);
205205
Matrix.setIdentityM(mViewMatrix, 0);
206206
Matrix.setIdentityM(mProjectionMatrix, 0);
@@ -291,11 +291,9 @@ private float getScreenAspect() {
291291
*
292292
* @param texture Photo object for texture
293293
*/
294-
public void setTexture(final Bitmap texture) {
294+
public synchronized void setTexture(final Bitmap texture) {
295295
if (mTexture != null && mIsDestroyTextureOnUpdate) {
296296
try {
297-
GLES20.glDeleteTextures(1, mTextures, 0);
298-
//checkGlError("AAA", "glDeleteTextures");
299297
mTexture.recycle();
300298
} catch (Throwable e) {
301299
e.printStackTrace();

0 commit comments

Comments
 (0)