Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/163.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 叮当声地址消毒剂检测SDL2泄漏_C++_Memory Leaks_Sdl_Sdl 2_Clang++ - Fatal编程技术网

C++ 叮当声地址消毒剂检测SDL2泄漏

C++ 叮当声地址消毒剂检测SDL2泄漏,c++,memory-leaks,sdl,sdl-2,clang++,C++,Memory Leaks,Sdl,Sdl 2,Clang++,每当我初始化SDL2例程时,就会出现泄漏。 e、 这是一个简单的代码 #include <iostream> #include <SDL.h> int main() { if (SDL_Init(SDL_INIT_VIDEO) != 0){ std::cerr << "SDL_Init error: " << SDL_GetError() << std::endl; return 1;

每当我初始化SDL2例程时,就会出现泄漏。 e、 这是一个简单的代码

#include <iostream>
#include <SDL.h>

int main() {
    if (SDL_Init(SDL_INIT_VIDEO) != 0){
        std::cerr << "SDL_Init error: " << SDL_GetError() << std::endl;
        return 1;
    }

    SDL_Quit();
    return 0;
}
为什么我有这些内存泄漏,而gcc没有告诉我任何事情

==11672==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 12 byte(s) in 2 object(s) allocated from:
    #0 0x49b1db in malloc (/home/***/build/a.out+0x49b1db)
    #1 0x7f979eb12f39 in __GI___strdup (/usr/lib/libc.so.6+0x7ff39)

SUMMARY: AddressSanitizer: 12 byte(s) leaked in 2 allocation(s).