aboutsummaryrefslogtreecommitdiff
path: root/tests/sdl_surface_refcount.c
blob: c4314ebf3dc279f3910fb6261ed2bf7547ed0bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <SDL.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
    SDL_Surface* surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 10, 10, 32,
                                                0, 0, 0, 0);
    SDL_Surface *reference = surface;
    reference->refcount++;
    SDL_FreeSurface(surface);
    SDL_FreeSurface(reference);
    int result = surface->refcount;
    REPORT_RESULT();
    return 0;
}