我正在尝试在退出应用程序时断开特征通知.以下是我在exitCleanup()函数中的操作方法:
if (btGatt != null && mWriteChar != null) {
boolean b=btGatt.setCharacteristicNotification(mWriteChar, false);
Log.w("AppInfo", "Exiting and Unsubscribing: " + b);
}
Run Code Online (Sandbox Code Playgroud)
日志显示:Exiting and Unsubscribing: true
.到现在为止还挺好.然后,我尝试使用以下方法完全断开GATT对象:
if (btGatt != null && btManager!=null && btManager.getConnectionState(btDevice, BluetoothProfile.GATT) != BluetoothProfile.STATE_DISCONNECTED ) {
//Making sure that gatt and bt manager are still with us
//Also making sure that the connection state is NOT disconnected
btGatt.disconnect();
btGatt.close();
Log.w( "AppInfo", "FINISHING. Connection state=" + btManager.getConnectionState(btDevice, BluetoothProfile.GATT) );
}
Run Code Online (Sandbox Code Playgroud)
这是事情变得奇怪的地方.日志现在显示以下内容:FINISHING. Connection state=2
,表示BluetoothDevice仍然连接.
这是一个问题,因为当应用程序完成并销毁所有资产时,BluetoothGattCallback仍会继续在幕后接收通知.首先它抛出以下NullPointerException:
04-25 …
Run Code Online (Sandbox Code Playgroud) 我的情况似乎很奇怪.我会尝试提供足够的细节,以便比我聪明的人可以解释这一点.基本上这里是设置:
OS: Android 2.2 Froyo
Device: SGS Vibrant
Application: OpenGL-ES 1.1
Run Code Online (Sandbox Code Playgroud)
这就是问题所在:我可以成功渲染一个相当复杂的场景,它可以无限运行几个小时而不会泄漏任何内存.Dalvikvm每隔3-5分钟出现在logcat中一次,除非我尝试退出我的应用程序并再次运行它,否则没有问题.事实上,我可以重启我的应用程序2次,但第三次,我得到了GL_OUT_OF_MEMORY
.
我已经跟踪了gl.glDrawArrays()
电话中的错误.我可以确认gl.glGetError()
在DrawArrays调用之前返回0,并且在DrawArrays调用之后它将返回1285(GL_OUT_OF_MEMORY).
当然,我认为我没有清理资源并释放OpenGL上下文.以下是关闭应用程序时的操作.
for(int x=0; x<buffers.length; x++){
if(gl.glIsBuffer(buffers[x])){
gl.glDeleteBuffers(1, buffers, x);
buffers[x]=0;
}
}
for(int y=0; y<textures.length; y++){
if(gl.glIsTexture(textures[y])){
gl.glDeleteTextures(1, textures, y);
textures[y]=0;
}
}
System.out.println("ERROR: "+gl.glGetError());
finish();
Run Code Online (Sandbox Code Playgroud)
当我前两次运行我的应用程序时,我不会在关机时返回任何错误.但是在第3次尝试时,我得到了上述错误,我追踪到了这个问题gl.glDrawArrays()
.
以下是第3次运行期间发生的事情的简要概述:
对象1-56 gl.glDrawArrays()
通过黄油等热刀进行各自的通话.没有生成错误.
对象57-64生成GL_OUT_OF_MEMORY
错误.对象被渲染,但纹理是黑色的.
我更确定我在应用程序关闭时删除所有缓冲区和纹理.我也相信这个错误不是特定于一个3D模型,因为我试图跳过模型#57,但是#58仍然会得到这个错误.
请帮助,因为我的想法已经用完了!
根据官方 ACME.SH 文档链接,颁发证书就像运行以下命令一样简单:
$ acme.sh --issue --alpn -d example.com
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误
Error, can not get domain token entry example.com for `tls-alpn-01`
The supported validation types are `http-01` `dns-01` , but you specified: `tls-alpn-01`
Run Code Online (Sandbox Code Playgroud)
我尝试从默认切换ZeroSSL.com
到BuyPass.com
,但这没有帮助。这些提供商似乎不允许tls-alpn-01
验证方法,但这可能与我缺少的东西有关。
PS:抢先回答一些问题:
port 80
被 ISP 阻止,因此tls-alpn-01
netstat
端口 443 是否未绑定到服务。--debug 2
,我得到以下_authorizations_map
变量值_authorizations_map='example.com,{"identifier":{"type":"dns","value":"example.com"},"status":"pending","expires":"2021-08-18T22 :53:50Z","挑战":[{"type":"http-01","url":"https://acme.zerossl.com/v2/DV90/chall/wYehJ8kQjUDiDadBJ12qKw","状态": "待处理","令牌":"Sfga2N2KwV-2hg3wo1gYAoyFvqV87dRvG2sHw4I6ups"},{"type":"dns-01","url":"https://acme.zerossl.com/v2/DV90/chall/CkrMQdEJthf-TmWvllW -Bg", "状态":"待处理","令牌":"_AlgMGzIfSQs7673Su-njnpieba_zLpSYxiUdXDEFnz"}]}'