Giter Site home page Giter Site logo

Comments (7)

texus avatar texus commented on July 23, 2024

But is it really needed to implement a virtual destructor? It is only needed when you are using a pointer to a derived class. And Gui isn't intended to be used as base class, neither should u use new and delete.

from tgui.

Wizzard033 avatar Wizzard033 commented on July 23, 2024

The usage of new and delete with tgui::Gui in my circumstance comes from binding TGUI to a scripting language.
As I am not using C++ when I create and delete instances, using C++ scoping rules is out of the question.

from tgui.

Wizzard033 avatar Wizzard033 commented on July 23, 2024

I suppose instead of using new/delete I could create a global container of GUI instances...
This is a nuisance though. My previous code worked and only broke as a result of updating TGUI.
The scripting language I use, Squirrel, was already made for plugging in new/delete or malloc/free in this scenario.
Doing anything different would be a hack...

Edit: Extra, unnecessary copying would be involved too in making the global container hack...

from tgui.

texus avatar texus commented on July 23, 2024

Using new/delete is ok then in your situation, and you should be able to safely ignore this warning.
I'll either implement an empty virtual destructor, or mark the class as final. But I'll see about that later.

from tgui.

Wizzard033 avatar Wizzard033 commented on July 23, 2024

Removing the virtual keyword from all members that have it is an option too...

from tgui.

texus avatar texus commented on July 23, 2024

I'll look into this later. I'm currently writing something for LD, so I don't want to spend too much time on my gui right now.
And because it is just a warning I think it can be ignored for a few days.

from tgui.

Wizzard033 avatar Wizzard033 commented on July 23, 2024

No problem
Thank you for the nearly immediate responses.

from tgui.

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.