Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve exception safety with smart pointers #31

Closed
elfring opened this issue Dec 31, 2024 · 10 comments
Closed

Improve exception safety with smart pointers #31

elfring opened this issue Dec 31, 2024 · 10 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@elfring
Copy link

elfring commented Dec 31, 2024

Describe the bug

Would you like to wrap any pointers with the class template std::unique_ptr?

[edited for reason: removed external links]

Steps to reproduce

No response

Expected behavior

No response

Software version

1.8

Download medium

built from source

Platform running

Linux

Architecture running

x86_64 (64-bit)

Other (please specify)

No response

Additional context

No response

Log

No response

Screenshot

No response

@elfring elfring added the bug Something isn't working label Dec 31, 2024
@ctlcltd ctlcltd added question Further information is requested and removed bug Something isn't working labels Dec 31, 2024
@ctlcltd
Copy link
Owner

ctlcltd commented Jan 3, 2025

This issue is invalid. Exceptions are handled correctly. If you are aware of critical bug, errors, software crashes, you can open a new issue. Please contextualize any issue reported. Thanks

@ctlcltd ctlcltd added invalid This doesn't seem right and removed question Further information is requested labels Jan 3, 2025
@ctlcltd ctlcltd closed this as completed Jan 3, 2025
@elfring
Copy link
Author

elfring commented Jan 3, 2025

  • 🔮 Can you become more aware that there can be a risk for a memory leak if C++ exceptions are not properly handled so far?
  • 💭 Would you like to take the C++ guideline “R.11: Avoid calling new and delete explicitly” better into account?

[edited for reason: removed external links]

@elfring
Copy link
Author

elfring commented Jan 3, 2025

🔮 Under which circumstances would you become interested to adjust implementation details like the following?

void printable::print()
{
debug("print");
QPrinter* printer = new QPrinter;
QTextDocument* doc = new QTextDocument;

@ctlcltd
Copy link
Owner

ctlcltd commented Jan 3, 2025

As previously stated: exceptions are handled correctly.
Code is checked with specific tools to check for memory leaks, this happens at least every two releases. Different compilers in use do not encounter errors or critical issues. The software runs correctly without interruptions, during the tests carried out no crashes or data corruption emerged.
Please note that with each release, improvements and refactoring of the code are progressively made. As already stated, if you are aware of real errors (real problems that interrupt the use of the software), you can open a new issue. Thanks

@elfring
Copy link
Author

elfring commented Jan 3, 2025

As previously stated: exceptions are handled correctly.

👀 The mentioned source code place contains known development concerns.
Do you overlook any consequences because of an exception like std::bad_alloc?
💭 I hope that such implementation details can be improved accordingly.

@ctlcltd
Copy link
Owner

ctlcltd commented Jan 3, 2025

I do not understand what problem you encountered with the software. Are you having problems with the printing feature? This issue has already been closed. You are telling me several things but I do not understand what the problem is, assuming there is a problem. If you encounter a problem that prevents you to run the software, you can report it in a new issue. This issue is marked as completed. Thanks for your availability

@elfring
Copy link
Author

elfring commented Jan 3, 2025

… You are telling me several things but I do not understand what the problem is, …

Why do you stumble on understanding difficulties for programming concerns according to mentioned C++ new expressions? 🤔

@ctlcltd
Copy link
Owner

ctlcltd commented Jan 3, 2025

I think I have figured out what the problem is. Sorry for the very practical approach but this is a repository and not the place to hold C++ programming lessons, lessons that I did not request. If you do not encounter any concrete problem with the software, we can move on, thanks. ⌚ We are wasting time that can be used for more important things. I invite you to not insist further with completely misleading things. As said: this issue is invalid and marked as completed.

@elfring
Copy link
Author

elfring commented Jan 3, 2025

… If you do not encounter any concrete problem with the software, we can move on, …

Known code review and analysis tools can point remaining open issues out for further improvements, can't they? 🤔

@ctlcltd
Copy link
Owner

ctlcltd commented Jan 4, 2025

There is no point in leaving situations pending, especially if they are opaque.

I already answered you above, but focused on acting like a bot you do not read my replies.
This issue is closed because it is invalid and not useful at all.

I will summarize your somewhat "unusual" behavior: open with an alarming title "safety exception", smart pointer arguments with a ironic question, asking questions acting like a bot, about memory leaks, link to documentation on external sites, show a code snippet that have nothing to do with exceptions, ask things that I have already answered.

This behavior is not helpful to me, nor to the users of the software, nor to you. So I can close it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants