You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dxinput): fix property reading and button mapping data processing
logic
- Replaced custom uchar array conversion function with C.GoBytes
to simplify data copying
- Modified get_prop function implementation to first obtain the
attribute data size, then read the data completely
- Corrected get_prop function parameters and comments; nbytes now
indicates byte length rather than item count
- Added free_prop_data function to release memory returned by
get_prop, preventing memory leaks
- Ensured proper release of C-allocated data after calling get_prop
to retrieve properties in the Go layer
- Removed unused maxBufferLen constant and the old ucharArrayToByte
implementation
Influence: Input Device Management
---
fix(dxinput): 修正属性读取和按钮映射数据处理逻辑
- 使用 C.GoBytes 替代自定义 uchar
数组转换函数简化数据拷贝
- 修改 get_prop
函数实现,先获取属性数据大小,再完整读取数据
- 修正 get_prop 函数参数和注释,nbytes
表示字节长度而非项目数
- 添加 free_prop_data 函数用于释放 get_prop
返回的内存,避免内存泄漏
- 在 Go 层调用 get_prop 获取属性后正确释放 C
分配的数据
- 删除无用的 maxBufferLen 常量和 ucharArrayToByte 旧实现
Influence: 输入设备管理功能
0 commit comments