overloaded global new and delete operators

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simbasaurus
    New Member
    • Aug 2007
    • 12

    overloaded global new and delete operators

    Hello!

    I am working on a really big project, in which the global new and delete operators can be overloaded, by including the file "overloadedops. h".
    The graphical interface was written using wxWidgets.
    The program crashes with SIGSEGV because my new and operators get called by wx functions.
    Could anyone explain why this happens and how can i avoid it (how can i make wx functions use the normal new and delete operators)?

    Thank you very much,
    Simbasaurus.
  • DumRat
    New Member
    • Mar 2007
    • 93

    #2
    Originally posted by simbasaurus
    Hello!

    I am working on a really big project, in which the global new and delete operators can be overloaded, by including the file "overloadedops. h".
    The graphical interface was written using wxWidgets.
    The program crashes with SIGSEGV because my new and operators get called by wx functions.
    Could anyone explain why this happens and how can i avoid it (how can i make wx functions use the normal new and delete operators)?

    Thank you very much,
    Simbasaurus.

    Why don't you use namespaces?

    Comment

    • simbasaurus
      New Member
      • Aug 2007
      • 12

      #3
      Originally posted by DumRat
      Why don't you use namespaces?
      Can you be more specific?

      Comment

      • DumRat
        New Member
        • Mar 2007
        • 93

        #4
        Originally posted by simbasaurus
        Can you be more specific?
        Sorry, I thought it could be done in a namespace, but it appears that you can't overload new inside a namespace and it can only be overloaded globally or inside a class. My mistake.

        Comment

        Working...