Skip to content
Snippets Groups Projects
Commit 27b11bf6 authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Fixed crash on receiving messages

parent 3dd916f2
Branches
No related tags found
No related merge requests found
...@@ -9,9 +9,9 @@ func _ready(): ...@@ -9,9 +9,9 @@ func _ready():
pass pass
func _process(delta): func _process(delta):
#while _gdpd.has_message() : while _gdpd.has_message() :
# var msg = _gdpd.get_next() var msg = _gdpd.get_next()
# print(\"got message from pd \", msg) print(\"got message from pd \", msg)
pass pass
func _load_patch(pd_patch) : func _load_patch(pd_patch) :
......
...@@ -182,6 +182,7 @@ int GdPd::start() { ...@@ -182,6 +182,7 @@ int GdPd::start() {
} }
void GdPd::stop() { void GdPd::stop() {
m_init=false;
m_audio.stopStream(); m_audio.stopStream();
m_audio.closeStream(); m_audio.closeStream();
m_pd.computeAudio(false); m_pd.computeAudio(false);
...@@ -235,8 +236,10 @@ void GdPd::subscribe(String symbStr) { ...@@ -235,8 +236,10 @@ void GdPd::subscribe(String symbStr) {
} }
bool GdPd::has_message() { bool GdPd::has_message() {
//receive new messages if(m_init) {
m_pd.receiveMessages(); //receive new messages
m_pd.receiveMessages();
}
//return if more than one message //return if more than one message
int size = m_messages->size(); int size = m_messages->size();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment