Giter Club home page Giter Club logo

Comments (3)

shivamprasad99 avatar shivamprasad99 commented on June 23, 2024 3

I am also getting same error:
free(): invalid pointer
Aborted (core dumped)
on building from the terminal in Ubuntu 18.04
What should I do?

from 3denginecpp.

Phobos03 avatar Phobos03 commented on June 23, 2024

Hello, I know that this is old repo, but I also have the same issue like shivamprasad99 with free(): invalid pointer
Aborted (core dumped). Maybe someone resolve this issue already?

from 3denginecpp.

gedeschaines avatar gedeschaines commented on June 23, 2024

Fixes to prevent Policy warnings from syntax errors in CMake code files.

  1. File: ./cmake/FindGLEW.cmake
    insert: SET(PROGRAMFILESX86 "PROGRAMFILES(X86)")
    before: SET( GLEW_SEARCH_PATHS
    and
    change: "$ENV{PROGRAMFILES(X86)}/GLEW"   # WINDOWS
        to: "$ENV{${PROGRAMFILESX86}}/GLEW"     # WINDOWS
  1. File: ./cmake/FindSDL2.cmake
    insert: SET(PROGRAMFILESX86 "PROGRAMFILES(X86)")
    before: SET( SDL2_SEARCH_PATHS
    and
    change: "$ENV{PROGRAMFILES(X86)}/SDL2"     # WINDOWS
        to: "$ENV{${PROGRAMFILESX86}}/SDL2"   # WINDOWS
  1. File: ./cmake/FindASSIMP.cmake
    insert: SET(PROGRAMFILESX86 "PROGRAMFILES(X86)")
    before: SET( ASSIMP_SEARCH_PATHS
    and
    change: "$ENV{PROGRAMFILES(X86)}/ASSIMP"	# WINDOWS
        to: "$ENV{${PROGRAMFILESX86}}/ASSIMP"	# WINDOWS

Fixes to prevent program execution abort on free(): invalid pointer.

  1. File: ./src/rendering/texture.h, line 60
    from: void operator=(Texture texture);
      to: Texture& operator=(Texture other) noexcept;
  1. File: ./src/rendering/texture.cpp, lines 207-213

    replace:

    void Texture::operator=(Texture texture)
    {
        char* temp[sizeof(Texture)/sizeof(char)];
        memcpy(temp, this, sizeof(Texture));
	memcpy(this, &texture, sizeof(Texture));
        memcpy(&texture, temp, sizeof(Texture));
    }
  with:
    Texture& Texture::operator=(Texture other) noexcept
    {
        //Implemented using move assignment.
    
        //Guard self assignment
        if (this == &other)
            return *this;
    
        if(m_textureData && m_textureData->RemoveReference())
	{
            if(m_fileName.length() > 0)
                s_resourceMap.erase(m_fileName);
	    
	        delete m_textureData;
	}
	m_fileName = other.m_fileName;
        m_textureData = other.m_textureData;
        m_textureData->AddReference();
        return *this;
    }

from 3denginecpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.