Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
7f9af901
Verified
Commit
7f9af901
authored
2 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Fix a few minor leaks (or just memory showing up as not freed in tools)
parent
2157ebb6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4209
passed
2 years ago
Stage: deploy
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/Utils.cpp
+3
-2
3 additions, 2 deletions
src/Utils.cpp
src/main.cpp
+12
-2
12 additions, 2 deletions
src/main.cpp
src/voip/CallDevices.cpp
+12
-1
12 additions, 1 deletion
src/voip/CallDevices.cpp
src/voip/CallDevices.h
+1
-0
1 addition, 0 deletions
src/voip/CallDevices.h
with
28 additions
and
5 deletions
src/Utils.cpp
+
3
−
2
View file @
7f9af901
...
...
@@ -598,7 +598,7 @@ utils::markdownToHtml(const QString &text, bool rainbowify)
int
charIdx
=
0
;
while
(
cmark_iter_next
(
iter
)
!=
CMARK_EVENT_DONE
)
{
cmark_node
*
cur
=
cmark_iter_get_node
(
iter
);
// only text nodes (no code or s
e
milar)
// only text nodes (no code or s
i
milar)
if
(
cmark_node_get_type
(
cur
)
!=
CMARK_NODE_TEXT
)
continue
;
...
...
@@ -608,7 +608,7 @@ utils::markdownToHtml(const QString &text, bool rainbowify)
QString
buf
;
int
boundaryStart
=
0
;
int
boundaryEnd
=
0
;
// use QTextBoundaryFinder to iterate o
f
er graphemes
// use QTextBoundaryFinder to iterate o
v
er graphemes
QTextBoundaryFinder
tbf
(
QTextBoundaryFinder
::
BoundaryType
::
Grapheme
,
nodeText
);
while
((
boundaryEnd
=
tbf
.
toNextBoundary
())
!=
-
1
)
{
charIdx
++
;
...
...
@@ -654,6 +654,7 @@ utils::markdownToHtml(const QString &text, bool rainbowify)
// The buffer is no longer needed.
free
((
char
*
)
tmp_buf
);
cmark_node_free
(
node
);
auto
result
=
linkifyMessage
(
escapeBlacklistedHtml
(
QString
::
fromStdString
(
html
))).
trimmed
();
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
12
−
2
View file @
7f9af901
...
...
@@ -37,9 +37,11 @@
#include
"notifications/Manager.h"
#endif
#if
def
ined(
GSTREAMER_AVAILABLE
) && (defined(Q_OS_MAC) || defined(Q_OS_WINDOWS))
#ifdef
GSTREAMER_AVAILABLE
#include
<QAbstractEventDispatcher>
#include
<gst/gst.h>
#include
"voip/CallDevices.h"
#endif
#ifdef QML_DEBUGGING
...
...
@@ -399,5 +401,13 @@ main(int argc, char *argv[])
nhlog
::
ui
()
->
info
(
"starting nheko {}"
,
nheko
::
version
);
return
app
.
exec
();
auto
returnvalue
=
app
.
exec
();
#ifdef GSTREAMER_AVAILABLE
CallDevices
::
instance
().
deinit
();
gst_deinit
();
#endif
return
returnvalue
;
}
This diff is collapsed.
Click to expand it.
src/voip/CallDevices.cpp
+
12
−
1
View file @
7f9af901
...
...
@@ -248,10 +248,11 @@ tokenise(std::string_view str, char delim)
}
}
static
GstDeviceMonitor
*
monitor
=
nullptr
;
void
CallDevices
::
init
()
{
static
GstDeviceMonitor
*
monitor
=
nullptr
;
if
(
!
monitor
)
{
monitor
=
gst_device_monitor_new
();
GstCaps
*
caps
=
gst_caps_new_empty_simple
(
"audio/x-raw"
);
...
...
@@ -273,6 +274,16 @@ CallDevices::init()
}
}
void
CallDevices
::
deinit
()
{
if
(
monitor
)
{
gst_device_monitor_stop
(
monitor
);
g_free
(
monitor
);
monitor
=
nullptr
;
}
}
bool
CallDevices
::
haveMic
()
const
{
...
...
This diff is collapsed.
Click to expand it.
src/voip/CallDevices.h
+
1
−
0
View file @
7f9af901
...
...
@@ -46,4 +46,5 @@ private:
public
:
CallDevices
(
CallDevices
const
&
)
=
delete
;
void
operator
=
(
CallDevices
const
&
)
=
delete
;
void
deinit
();
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment