소스 검색

fix drm resources leak (#5494)

pull/5498/head
Matthew Kennedy 1 주 전
committed by GitHub
부모
커밋
026b7e808a
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. +4
    -4
      src/platforms/rcore_drm.c

+ 4
- 4
src/platforms/rcore_drm.c 파일 보기

@ -1161,7 +1161,8 @@ int InitPlatform(void)
platform.fd = open("/dev/dri/by-path/platform-gpu-card", O_RDWR); // VideoCore VI (Raspberry Pi 4)
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: platform-gpu-card opened successfully");
if ((platform.fd == -1) || (drmModeGetResources(platform.fd) == NULL))
drmModeRes *res = NULL;
if ((platform.fd == -1) || ((res = drmModeGetResources(platform.fd)) == NULL))
{
if (platform.fd != -1) close(platform.fd);
TRACELOG(LOG_WARNING, "DISPLAY: Failed to open platform-gpu-card, trying card1");
@ -1169,7 +1170,7 @@ int InitPlatform(void)
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: card1 opened successfully");
}
if ((platform.fd == -1) || (drmModeGetResources(platform.fd) == NULL))
if ((platform.fd == -1) || (p">(res = drmModeGetResources(platform.fd)) == NULL))
{
if (platform.fd != -1) close(platform.fd);
TRACELOG(LOG_WARNING, "DISPLAY: Failed to open graphic card1, trying card0");
@ -1177,7 +1178,7 @@ int InitPlatform(void)
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: card0 opened successfully");
}
if ((platform.fd == -1) || (drmModeGetResources(platform.fd) == NULL))
if ((platform.fd == -1) || (p">(res = drmModeGetResources(platform.fd)) == NULL))
{
if (platform.fd != -1) close(platform.fd);
TRACELOG(LOG_WARNING, "DISPLAY: Failed to open graphic card0, trying card2");
@ -1192,7 +1193,6 @@ int InitPlatform(void)
return -1;
}
drmModeRes *res = drmModeGetResources(platform.fd);
if (!res)
{
TRACELOG(LOG_WARNING, "DISPLAY: Failed get DRM resources");

불러오는 중...
취소
저장