Skip to content

Comments

Fixes/build warnings#105

Open
ikmsk10 wants to merge 2 commits intoeddic:masterfrom
ikmsk10:fixes/build-warnings
Open

Fixes/build warnings#105
ikmsk10 wants to merge 2 commits intoeddic:masterfrom
ikmsk10:fixes/build-warnings

Conversation

@ikmsk10
Copy link

@ikmsk10 ikmsk10 commented Jun 26, 2021

The PR solves the #104

  • Fix inherit base classes without virtual destructors
  • Prevent -Wunused-parameter warning.

ikmsk10 added 2 commits June 26, 2021 17:25
Several classes might be inherited in end-web-applications, but these
haven't virtual destructors, which might lead to memory leaks.

* Add virtual destruct the bellow classes:
  + Manager_base
  + Mailer
  + Email_base; Email
  + Poll
  + Socket; SocketGroup
  + Transceiver
  + Connection
  + Curler
  + FcgiStreambuf

Testing: added `virtual` to the `EmailSender::response()` method of
`email.cpp` example for tesing reasons; build the examples targets with
`-Wnon-virtual-dtor` flag, and there are has no warnings.

Please, note, the `-Wnon-virtual-dtor` flag is not added to the
CMakeLists to be consistent for end-applications, which already uses the
`fastcgipp`.

End-user-impact: None.

Signed-off-by: Igor Kononenko <i.kononenko@yadro.com>
End-user-impact: None.

Signed-off-by: Igor Kononenko <i.kononenko@yadro.com>
@eddic
Copy link
Owner

eddic commented Sep 1, 2021

Hey Igor. I'm just getting to this now. Thanks for this pull request. This is very well done. A couple questions first though:

  • The [[maybe_unused]] attribute. This is listed as C++17. The fastcgi++ project is C++14 at this point. I'm a little worried about this but unsure. Will this effect backwards compatibility?
  • The virtual destructors you've added. For most of them the need is evident. Some, however, I am unclear on. I've always been a little leery about creating vtables for classes that aren't intended to be used polymorphically. Most of these already have vtables but I believe some do not. What are your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants