fix(valgrind): Suppress Xrm warnings
This commit is contained in:
parent
5077325044
commit
357e95335a
@ -66,3 +66,20 @@
|
|||||||
...
|
...
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
xresource manager
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: definite
|
||||||
|
fun:realloc
|
||||||
|
obj:/usr/lib/libX11.so.6.3.0
|
||||||
|
obj:/usr/lib/libX11.so.6.3.0
|
||||||
|
obj:/usr/lib/libX11.so.6.3.0
|
||||||
|
fun:_XlcCreateLC
|
||||||
|
fun:_XlcDefaultLoader
|
||||||
|
fun:_XOpenLC
|
||||||
|
fun:_XrmInitParseInfo
|
||||||
|
obj:/usr/lib/libX11.so.6.3.0
|
||||||
|
fun:XrmGetStringDatabase
|
||||||
|
...
|
||||||
|
...
|
||||||
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <X11/X.h>
|
||||||
#include <X11/Xresource.h>
|
#include <X11/Xresource.h>
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
@ -22,8 +23,9 @@ class xresource_manager {
|
|||||||
string load_value(const string& key, const string& res_type, size_t n) const;
|
string load_value(const string& key, const string& res_type, size_t n) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* m_manager{nullptr};
|
Display* m_display{nullptr};
|
||||||
XrmDatabase m_db;
|
XrmDatabase m_db;
|
||||||
|
char* m_manager{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
POLYBAR_NS_END
|
POLYBAR_NS_END
|
||||||
|
@ -22,13 +22,11 @@ xresource_manager::make_type xresource_manager::make() {
|
|||||||
xresource_manager::xresource_manager() {
|
xresource_manager::xresource_manager() {
|
||||||
XrmInitialize();
|
XrmInitialize();
|
||||||
|
|
||||||
if (xlib::get_display() == nullptr) {
|
if ((m_display = xlib::get_display()) == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
} else if ((m_manager = XResourceManagerString(xlib::get_display())) == nullptr) {
|
||||||
if ((m_manager = XResourceManagerString(xlib::get_display())) == nullptr) {
|
|
||||||
return;
|
return;
|
||||||
}
|
} else if ((m_db = XrmGetStringDatabase(m_manager)) == nullptr) {
|
||||||
if ((m_db = XrmGetStringDatabase(m_manager)) == nullptr) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user