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