lib/amqp/session.rb in amqp-1.6.0 vs lib/amqp/session.rb in amqp-1.7.0

- old
+ new

@@ -928,12 +928,15 @@ def receive_frame(frame) @frames[frame.channel] ||= Array.new @frames[frame.channel] << frame if frameset_complete?(@frames[frame.channel]) - receive_frameset(@frames[frame.channel]) - # for channel.close, frame.channel will be nil. MK. - clear_frames_on(frame.channel) if @frames[frame.channel] + begin + receive_frameset(@frames[frame.channel]) + ensure # Ensure that frames always will be cleared + # for channel.close, frame.channel will be nil. MK. + clear_frames_on(frame.channel) if @frames[frame.channel] + end end end # Processes a frameset by finding and invoking a suitable handler. # Heartbeat frames are treated in a special way: they simply update @last_server_heartbeat