mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
Revert "Fix potential memory leaks"
This commit is contained in:
@ -69,7 +69,7 @@ class UPower : public AModule {
|
||||
UpDevice *displayDevice;
|
||||
guint login1_id;
|
||||
GDBusConnection *login1_connection;
|
||||
std::unique_ptr<UPowerTooltip> upower_tooltip;
|
||||
UPowerTooltip *upower_tooltip;
|
||||
std::string lastStatus;
|
||||
bool showAltText;
|
||||
bool upowerRunning;
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
@ -17,7 +16,7 @@ class UPowerTooltip : public Gtk::Window {
|
||||
|
||||
const std::string getDeviceIcon(UpDeviceKind& kind);
|
||||
|
||||
std::unique_ptr<Gtk::Box> contentBox;
|
||||
Gtk::Box* contentBox;
|
||||
|
||||
uint iconSize;
|
||||
uint tooltipSpacing;
|
||||
|
@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
template <typename Func>
|
||||
class scope_guard {
|
||||
public:
|
||||
explicit scope_guard(Func&& exit_function) : f{std::forward<Func>(exit_function)} {}
|
||||
scope_guard(const scope_guard&) = delete;
|
||||
scope_guard(scope_guard&&) = default;
|
||||
scope_guard& operator=(const scope_guard&) = delete;
|
||||
scope_guard& operator=(scope_guard&&) = default;
|
||||
~scope_guard() { f(); }
|
||||
|
||||
private:
|
||||
Func f;
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
Reference in New Issue
Block a user