Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 16bit_port

Pages: [1]
1
Window / memory leaks in sf::window?
« on: July 15, 2011, 12:22:51 am »
I'm using 1.6 and I re-compiled it through VS2010.

The leaks aren't the same as the one in that old thread (it's actually significantly larger), but according to your old post you're saying that it could just be that at the time of the reporting the memory wasn't freed yet but eventually is?

2
Window / memory leaks in sf::window?
« on: July 14, 2011, 11:23:45 pm »
I re-compiled sfml-system and sfml-window through VS2010

simple test program
Code: [Select]

//////// Used to check memory leaks
    #include <stdlib.h>
    #include "LeakCheck.h"
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;

#include <SFML/Window.hpp>

#pragma comment( lib, "sfml-system-d" )
#pragma comment( lib, "sfml-window-d" )

int main()
{
    #ifdef _DEBUG
        _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
        _CrtDumpMemoryLeaks();
    #endif

    sf::Window App;

    return 0;
}


and here is my output :
Code: [Select]

Detected memory leaks!
Dumping objects ->
{130} normal block at 0x006C4858, 8 bytes long.
 Data: <        > BC A2 03 10 00 00 00 00
{129} normal block at 0x006C4808, 20 bytes long.
 Data: < Hl  Hl  Hl     > 08 48 6C 00 08 48 6C 00 08 48 6C 00 CD CD CD CD
{128} normal block at 0x006C47C0, 8 bytes long.
 Data: < Fl     > 0C 46 6C 00 00 00 00 00
{127} normal block at 0x006C4600, 384 bytes long.
 Data: < =           Gl > 88 3D 03 10 01 00 00 00 01 00 00 00 C0 47 6C 00
{126} normal block at 0x006C45C0, 4 bytes long.
 Data: < Fl > 00 46 6C 00
Object dump complete.
The thread 'Win32 Thread' (0x930) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x120) has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{129} normal block at 0x006C4808, 20 bytes long.
 Data: < Hl  Hl  Hl     > 08 48 6C 00 08 48 6C 00 08 48 6C 00 CD CD CD CD
{128} normal block at 0x006C47C0, 8 bytes long.
 Data: < Fl     > 0C 46 6C 00 00 00 00 00
{127} normal block at 0x006C4600, 384 bytes long.
 Data: < =           Gl > 88 3D 03 10 01 00 00 00 01 00 00 00 C0 47 6C 00
{126} normal block at 0x006C45C0, 4 bytes long.
 Data: < Fl > 00 46 6C 00
Object dump complete.
The program '[3888] test SFML.exe: Native' has exited with code 0 (0x0).


LeakCheck.h
Code: [Select]

#ifdef _MSC_VER
    #include "NewDebug.h"
    #ifdef _DEBUG
        //WARNING: no matching operator delete found; memory will not be freed if initialization throws an exception
        #pragma warning( disable: 4291 )
        #define new NEW_DEBUG
    #endif
#endif


NewDebug.h
Code: [Select]

#ifndef _NEW_DEBUG_H
#define _NEW_DEBUG_H
    #include <crtdbg.h>
    #ifdef _DEBUG
        void* operator new( size_t BlockSize, const char *File, int Line );
        #define NEW_DEBUG new( THIS_FILE, __LINE__ )
        #define malloc(Size) _malloc_dbg( Size, _NORMAL_BLOCK, THIS_FILE, __LINE__  );
    #endif
#endif


NewDebug.cpp
Code: [Select]

#ifdef _MSC_VER
    #pragma warning (disable: 4514 ) // Suppress 'unreferenced inline function has been removed'
    #ifdef _DEBUG
        #include <crtdbg.h>
        void* operator new( size_t Size, const char * FileName, int Line )
        {
            return ::operator new( Size, _NORMAL_BLOCK, FileName, Line );
        }
    #endif
#endif


What's going on? I'm looking at the source for sf::Window() and it's an empty constructor, so what could be causing this so-called memory leak?

3
Window / [SOLVED] Very simple window (crashes)
« on: July 14, 2011, 07:36:59 pm »
Thank you. That did the trick.

4
Window / [SOLVED] Very simple window (crashes)
« on: July 14, 2011, 05:43:28 pm »
I linked to the system library and I still get the same crash.

Release mode :
Code: [Select]

#include <SFML/Window.hpp>

#pragma comment( lib, "sfml-system" )
#pragma comment( lib, "sfml-window" )

int main()
{
    sf::Window App1( sf::VideoMode(800, 600, 32), "Window 1" );
    App1.Close();
    return 0;
}


The reason why I linked both versions is because if I link just the debug libraries

Code: [Select]

// debug mode

#include <SFML/Window.hpp>

#pragma comment( lib, "sfml-system-d" )
#pragma comment( lib, "sfml-window-d" )

int main()
{
    sf::Window App1( sf::VideoMode(800, 600, 32), "Window 1" );
    App1.Close();
    return 0;
}


I get "The application was unable to start correctly (0xc0150002). Click OK to close the application."

However, if I link both versions
Code: [Select]

// debug mode

#include <SFML/Window.hpp>

#pragma comment( lib, "sfml-system" )
#pragma comment( lib, "sfml-system-d" )
#pragma comment( lib, "sfml-window" )
#pragma comment( lib, "sfml-window-d" )

int main()
{
    sf::Window App1( sf::VideoMode(800, 600, 32), "Window 1" );
    App1.Close();
    return 0;
}


I don't get THAT error BUT it still crashes with the message in the original post.

Also all of the dlls are in the executable directory.

5
Window / [SOLVED] Very simple window (crashes)
« on: July 14, 2011, 05:17:37 pm »
I'm using the 1.6 version and VS2010.

Code: [Select]
#include <SFML/Window.hpp>

#pragma comment( lib, "sfml-window" )
#pragma comment( lib, "sfml-window-d" )

int main()
{
    sf::Window App1( sf::VideoMode(800, 600, 32), "Window 1" );
    App1.Close();
    return 0;
}


It crashes at exit of main() (at } ). It says "Run-Time Check Failure #2 - Stack around the variable 'App1' was corrupted."

It happens with both debug and release build.

Pages: [1]
anything