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

Start SmartPointers #1679

Merged
merged 38 commits into from
Feb 25, 2024
Merged

Start SmartPointers #1679

merged 38 commits into from
Feb 25, 2024

Conversation

Lord-Grey
Copy link
Collaborator

@Lord-Grey Lord-Grey commented Jan 3, 2024

Summary

Note: PR includes main changes of #1678

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:
Fixes #981

@Lord-Grey Lord-Grey self-assigned this Jan 3, 2024
include/utils/ImageData.h Fixed Show fixed Hide fixed
@Lord-Grey Lord-Grey mentioned this pull request Jan 7, 2024
1 task
src/hyperiond/hyperiond.cpp Fixed Show fixed Hide fixed
@Lord-Grey Lord-Grey merged commit 31df065 into hyperion-project:master Feb 25, 2024
18 checks passed
@@ -56,6 +56,8 @@ GrabberWrapper::GrabberWrapper(const QString& grabberName, Grabber * ggrabber, i

GrabberWrapper::~GrabberWrapper()
{
_timer->stop();
delete _timer;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 Should such an operation be performed by a smart pointer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That would work.

Unfortunately, we are only two developers currently and do have the bandwidth cleaning up the whole code base proactively now. Esp. Like for the sample where the code correctly works and there is limited immediate benefit.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you think about to avoid redundant code a bit more? 🤔

Copy link
Collaborator Author

@Lord-Grey Lord-Grey Feb 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, I get your question…
Maybe you can clarify.

In case of new additions or refactoring code, now Smartpointers can be used to avoid additional boilerplate and make code more maintainable.
Nevertheless, there are more serious problems out there than removing working statements like above.
E.g. the grabber design is not consistent any longer and not every grabber is scalable.
Spending refactoring effort in that light would make great sense including removing redundant code.

We would be happy, if you and others would give us a helping hand in cleaning up current code and/or designs.

Paulchen-Panther added a commit to Paulchen-Panther/hyperion.ng that referenced this pull request Mar 3, 2024
* Refactor to fix hyperion-project#1671

* Add GUI/NonGUI mode to info page

* Do not show lock config, if in non-UI mode

* Updae Changelog

* Correct includes

* Ensure key member initialization - RGB Channels

* Ensure key member initialization - WebServer

* Update RGBChannels

* Fix initialization order

* Fix key when inserting new logger in LoggerMap,
Prepare logBuffer-JSON snapshot view in LoggerManager,
Increase buffered loglines to 500

* Fix Memory leak in GrabberWrapper

* Fix Memory leak in BlackBorderProcessor

* Fix Memory leak in BlackBorderProcessor

* use ninja generator under macos

* Fix BGEffectHandler destruction

* Fix Mdns code

* Clear list after applying qDeleteAll

* Fix deletion of CecHandler

* Fix memory leak caused by wrong buffer allocation

* Remove extra pixel consistently

* Change mDNS to Qt SmartPointers

* Correct removal

* Fix usage of _width/_height (they are the output resolution, not the screen resolution)
That avoids unnecessary resizing of the output image with every transferFrame call

* Move main non Thread Objects to Smart Pointers

* Refactor Hyperion Daemon unsing smartpointers

* Correction

* Correct typos/ align text

* Fix startGrabberDispmanx

* Fix startGrabberDispmanx

* Address CodeQL finding

* Create Screen grabbers via Template

* Fix typo

* Change way of logging

* Revert change

* Address deprecation warning

* Correct auto screen grabber evaluation

---------

Co-authored-by: Paulchen-Panther <[email protected]>
Paulchen-Panther pushed a commit to Paulchen-Panther/hyperion.ng that referenced this pull request Mar 3, 2024
…1689)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump actions/cache from 3 to 4 (hyperion-project#1690)

Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump peter-evans/repository-dispatch from 2.1.2 to 3.0.0 (hyperion-project#1691)

Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 2.1.2 to 3.0.0.
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](peter-evans/repository-dispatch@v2.1.2...v3.0.0)

---
updated-dependencies:
- dependency-name: peter-evans/repository-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Workflow adapted to armv6

Corrections after release 2.0.16 (hyperion-project#1694)

* Updates on building a release

* Fixes

* Correct non arm64 identification

* Show download bar

* reset all units with failed status

* Reload systemd daemon after updates

* Force Qt5 for armv6 packages

---------

Co-authored-by: Paulchen-Panther <[email protected]>

fix workflow run

ProviderHID.cpp aktualisieren

update libusb

separate targets example

test RUN

test RUN

cache

path

powershell

installer

installer

installer

typo

test RUN

test RUN

test RUN

Refactor

Start SmartPointers (hyperion-project#1679)

* Refactor to fix hyperion-project#1671

* Add GUI/NonGUI mode to info page

* Do not show lock config, if in non-UI mode

* Updae Changelog

* Correct includes

* Ensure key member initialization - RGB Channels

* Ensure key member initialization - WebServer

* Update RGBChannels

* Fix initialization order

* Fix key when inserting new logger in LoggerMap,
Prepare logBuffer-JSON snapshot view in LoggerManager,
Increase buffered loglines to 500

* Fix Memory leak in GrabberWrapper

* Fix Memory leak in BlackBorderProcessor

* Fix Memory leak in BlackBorderProcessor

* use ninja generator under macos

* Fix BGEffectHandler destruction

* Fix Mdns code

* Clear list after applying qDeleteAll

* Fix deletion of CecHandler

* Fix memory leak caused by wrong buffer allocation

* Remove extra pixel consistently

* Change mDNS to Qt SmartPointers

* Correct removal

* Fix usage of _width/_height (they are the output resolution, not the screen resolution)
That avoids unnecessary resizing of the output image with every transferFrame call

* Move main non Thread Objects to Smart Pointers

* Refactor Hyperion Daemon unsing smartpointers

* Correction

* Correct typos/ align text

* Fix startGrabberDispmanx

* Fix startGrabberDispmanx

* Address CodeQL finding

* Create Screen grabbers via Template

* Fix typo

* Change way of logging

* Revert change

* Address deprecation warning

* Correct auto screen grabber evaluation

---------

Co-authored-by: Paulchen-Panther <[email protected]>

Disable current service, even if not active

build Hyperion under MacOS as a universal app (x68_64/arm64)
And of course a little "aufgeräumt"

Refactor

test RUN
@Lord-Grey Lord-Grey deleted the smartp branch May 20, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Improve exception safety with smart pointers
3 participants