Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7880479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:09:17+00:00 2026-06-03T04:09:17+00:00

Is it safe to do something like this? int foo(Display*, XErrorEvent*) { throw 0;

  • 0

Is it safe to do something like this?

int foo(Display*, XErrorEvent*) {
  throw 0;
}
XSetErrorHandler(foo);

I won’t run into any troubles?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:09:18+00:00Added an answer on June 3, 2026 at 4:09 am

    An X11 error handler is a callback provided by the user and called by Xlib. Any exception thrown from an error handler will propagate through Xlib code down to user code calling Xlib (typically XNextEvent or friends).

                   foo() <C++>
                     |
           [error is detected by Xlib] <C>
                     |
              [some more Xlib code] <C>
                     |
                [some Xlib code] <C>
                     |
                 XNextEvent()  <C>                 
                     |
                   main() <C++>
    

    Since Xlib is not written in C++, the C++ runtime does not necessarily know how to do the stack unwinding of Xlib code. Even if it by sheer luck manages to do the unwinding correctly, resources such as memory allocated by Xlib prior to calling the error handler may be lost. There are no automatic destructors in C!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to do something like this in django? INSERT INTO t
Is that safe to do something like this: char* charArray = new char[10]; strcat(charArray,
Can I do something like this in Java: protected Runnable getRunnable(final int seconds) {
I have a function like this: private void GetRSS(int start, int end) { for
I am thinking about something like this: public static <T extends Comparable<T>> T minOf(T...ts){
We all know you can't do things like this: int a = 7; new
Is it safe to do the following? std::list<Something> someList; ... someList.push_back(Something(8)); Something* something =
I am pretty new to thread-safe programming, and was wondering if I have something
I know it's safe to draw on any thread so long as I call
Is the following code safe? class B { public: int& b; B (int& _b)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.